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/IceDefs.h b/src/IceDefs.h
index 0e8cdfb..64e70de 100644
--- a/src/IceDefs.h
+++ b/src/IceDefs.h
@@ -201,7 +201,7 @@
ErrorCode &operator=(const ErrorCode &) = delete;
public:
- ErrorCode() : HasError(false) {}
+ ErrorCode() = default;
void assign(ErrorCodes Code) {
if (!HasError) {
HasError = true;
@@ -211,7 +211,7 @@
void assign(int Code) { assign(static_cast<ErrorCodes>(Code)); }
private:
- bool HasError;
+ bool HasError = false;
};
// Reverse range adaptors written in terms of llvm::make_range().