summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/optimizing/locations.cc5
-rw-r--r--compiler/optimizing/locations.h8
2 files changed, 7 insertions, 6 deletions
diff --git a/compiler/optimizing/locations.cc b/compiler/optimizing/locations.cc
index d157509758..a9fe209063 100644
--- a/compiler/optimizing/locations.cc
+++ b/compiler/optimizing/locations.cc
@@ -16,11 +16,16 @@
#include "locations.h"
+#include <type_traits>
+
#include "nodes.h"
#include "code_generator.h"
namespace art {
+// Verify that Location is trivially copyable.
+static_assert(std::is_trivially_copyable<Location>::value, "Location should be trivially copyable");
+
LocationSummary::LocationSummary(HInstruction* instruction,
CallKind call_kind,
bool intrinsified)
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index da27928ef2..52747c0cc4 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -91,12 +91,9 @@ class Location : public ValueObject {
DCHECK(!IsValid());
}
- Location(const Location& other) : value_(other.value_) {}
+ Location(const Location& other) = default;
- Location& operator=(const Location& other) {
- value_ = other.value_;
- return *this;
- }
+ Location& operator=(const Location& other) = default;
bool IsConstant() const {
return (value_ & kLocationConstantMask) == kConstant;
@@ -328,7 +325,6 @@ class Location : public ValueObject {
LOG(FATAL) << "Should not use this location kind";
}
UNREACHABLE();
- return "?";
}
// Unallocated locations.