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/IceFixups.h b/src/IceFixups.h
index 3b2b524..9ec72c3 100644
--- a/src/IceFixups.h
+++ b/src/IceFixups.h
@@ -28,7 +28,7 @@
AssemblerFixup &operator=(const AssemblerFixup &) = delete;
public:
- AssemblerFixup() : position_(0), kind_(0), value_(nullptr) {}
+ AssemblerFixup() = default;
AssemblerFixup(const AssemblerFixup &) = default;
intptr_t position() const { return position_; }
void set_position(intptr_t Position) { position_ = Position; }
@@ -47,9 +47,9 @@
void emit(GlobalContext *Ctx, RelocOffsetT BaseOffset) const;
private:
- intptr_t position_;
- FixupKind kind_;
- const Constant *value_;
+ intptr_t position_ = 0;
+ FixupKind kind_ = 0;
+ const Constant *value_ = nullptr;
};
typedef std::vector<AssemblerFixup> FixupList;