Subzero: Use C++11 member initializers where practical.
Also change the pattern "foo() {}" into "foo() = default;" for ctors and dtors.
Generally avoids initializing unique_ptr<> members to nullptr in a .h file, because that requires knowing the definition of the underlying class which may not be available to all includers.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/1197223002
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index aeb54ff..ddadc57 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -24,8 +24,7 @@
namespace Ice {
CfgNode::CfgNode(Cfg *Func, SizeT LabelNumber)
- : Func(Func), Number(LabelNumber), NameIndex(Cfg::IdentifierIndexInvalid),
- HasReturn(false), NeedsPlacement(false), InstCountEstimate(0) {}
+ : Func(Func), Number(LabelNumber) {}
// Returns the name the node was created with. If no name was given,
// it synthesizes a (hopefully) unique name.
@@ -949,8 +948,7 @@
const InstList &Insts)
: Asm(Asm), Target(Target), End(Insts.end()), BundleLockStart(End),
BundleSize(1 << Asm->getBundleAlignLog2Bytes()),
- BundleMaskLo(BundleSize - 1), BundleMaskHi(~BundleMaskLo),
- SizeSnapshotPre(0), SizeSnapshotPost(0) {}
+ BundleMaskLo(BundleSize - 1), BundleMaskHi(~BundleMaskLo) {}
// Check whether we're currently within a bundle_lock region.
bool isInBundleLockRegion() const { return BundleLockStart != End; }
// Check whether the current bundle_lock region has the align_to_end
@@ -1050,8 +1048,8 @@
const intptr_t BundleMaskLo;
// Masking with BundleMaskHi identifies an address's bundle.
const intptr_t BundleMaskHi;
- intptr_t SizeSnapshotPre;
- intptr_t SizeSnapshotPost;
+ intptr_t SizeSnapshotPre = 0;
+ intptr_t SizeSnapshotPost = 0;
};
} // end of anonymous namespace