Skip to content

Commit 8cc1455

Browse files
committed
For default constructors with all bases and class members default-initialized
and an empty constructor body, and for destructors with an empty body, move the definiton from the .cc file to the .h file with a = default definition. Default constructors and destructors defined with empty bodies in the header could be replaced with = default which is more specific than {} and could conceivably be more optimized. To minimize diffs, these {} default constructors and destructors in headers were left alone. Only if they were newly added or moved from .cc to .h files, was = default used instead of {}.
1 parent 291f8cc commit 8cc1455

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+30
-93
lines changed

src/sst/core/baseComponent.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
namespace SST {
3737

38-
BaseComponent::BaseComponent() : SST::Core::Serialization::serializable_base() {}
39-
4038
BaseComponent::BaseComponent(ComponentId_t id) :
4139
SST::Core::Serialization::serializable_base(),
4240
my_info(Simulation_impl::getSimulation()->getComponentInfo(id)),

src/sst/core/baseComponent.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
7070
BaseComponent*, Statistics::StatisticProcessingEngine*, const std::string& /*type*/,
7171
const std::string& /*name*/, const std::string& /*subId*/, Params&)>;
7272

73-
// For serialization only
74-
BaseComponent();
73+
BaseComponent() = default; // For serialization only
7574

7675
public:
7776
BaseComponent(ComponentId_t id);

src/sst/core/checkpointAction.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ CheckpointAction::CheckpointAction(
6262
setPriority(SYNCPRIORITY);
6363
}
6464

65-
CheckpointAction::~CheckpointAction() {}
66-
6765
// Generate checkpoint on simulation time period
6866
void
6967
CheckpointAction::execute()

src/sst/core/checkpointAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CheckpointAction : public Action
6464
Create a new checkpoint object for the simulation core to initiate checkpoints
6565
*/
6666
CheckpointAction(Config* cfg, RankInfo this_rank, Simulation_impl* sim, TimeConverter* period);
67-
~CheckpointAction();
67+
~CheckpointAction() = default;
6868

6969
/** Generate a checkpoint next time check() is called */
7070
void setCheckpoint();

src/sst/core/component.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Component::Component(ComponentId_t id) : BaseComponent(id)
3030
// currentlyLoadingSubComponent = my_info;
3131
}
3232

33-
Component::~Component() {}
34-
3533
void
3634
Component::registerAsPrimaryComponent()
3735
{
@@ -59,7 +57,4 @@ Component::serialize_order(SST::Core::Serialization::serializer& ser)
5957
BaseComponent::serialize_order(ser);
6058
}
6159

62-
// For serialization only
63-
Component::Component() : BaseComponent() {}
64-
6560
} // namespace SST

src/sst/core/component.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Component : public BaseComponent
4848
@param id Unique component ID
4949
*/
5050
Component(ComponentId_t id);
51-
virtual ~Component();
51+
virtual ~Component() override = default;
5252

5353
/** Register as a primary component, which allows the component to
5454
specify when it is and is not OK to end simulation. The
@@ -97,9 +97,7 @@ class Component : public BaseComponent
9797

9898
protected:
9999
friend class SubComponent;
100-
101-
// For Serialization only
102-
Component();
100+
Component() = default; // For Serialization only
103101
};
104102

105103
} // namespace SST

src/sst/core/componentExtension.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,4 @@ ComponentExtension::serialize_order(SST::Core::Serialization::serializer& ser)
2626
BaseComponent::serialize_order(ser);
2727
}
2828

29-
// For serialization only
30-
ComponentExtension::ComponentExtension() : BaseComponent() {}
31-
3229
} // namespace SST

src/sst/core/componentExtension.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ class ComponentExtension : public BaseComponent
3131
public:
3232
ComponentExtension(ComponentId_t id);
3333

34-
virtual ~ComponentExtension() {};
34+
virtual ~ComponentExtension() override = default;
3535

3636
private:
37-
// For serialization only
38-
ComponentExtension();
37+
ComponentExtension() = default; // For serialization only
3938

4039
ImplementSerializable(SST::ComponentExtension)
4140
void serialize_order(SST::Core::Serialization::serializer& ser) override;

src/sst/core/event.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ namespace SST {
2323
std::atomic<uint64_t> SST::Event::id_counter(0);
2424
const SST::Event::id_type SST::Event::NO_ID = std::make_pair(0, -1);
2525

26-
Event::~Event() {}
27-
2826
void
2927
Event::execute()
3028
{

src/sst/core/event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Event : public Activity
7979
last_comp = "";
8080
#endif
8181
}
82-
virtual ~Event();
82+
~Event() override = default;
8383

8484
/** Clones the event in for the case of a broadcast */
8585
virtual Event* clone();

0 commit comments

Comments
 (0)