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/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 03a5930..35ab024 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -77,9 +77,7 @@
}
TargetLowering::TargetLowering(Cfg *Func)
- : Func(Func), Ctx(Func->getContext()), HasComputedFrame(false),
- CallsReturnsTwice(false), StackAdjustment(0), NextLabelNumber(0),
- Context(), SnapshotStackAdjustment(0) {}
+ : Func(Func), Ctx(Func->getContext()), Context() {}
std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target,
Cfg *Func) {
@@ -445,7 +443,7 @@
llvm::report_fatal_error("Unsupported target data lowering");
}
-TargetDataLowering::~TargetDataLowering() {}
+TargetDataLowering::~TargetDataLowering() = default;
namespace {
@@ -566,6 +564,6 @@
llvm::report_fatal_error("Unsupported target header lowering");
}
-TargetHeaderLowering::~TargetHeaderLowering() {}
+TargetHeaderLowering::~TargetHeaderLowering() = default;
} // end of namespace Ice