summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-11-04 19:37:37 +0000
committer android-build-merger <android-build-merger@google.com> 2016-11-04 19:37:37 +0000
commitef36dce429b41e96ea85f33b6bf05f03288601da (patch)
tree25d7b9ddc610c868f8021dcca287d53a586dd3c4
parent5f892500c74b06b9a4a467beafc7536c0c95801a (diff)
parent8f2179aca19e251cf5bc7ee4922d2a043aa2105c (diff)
ART: Make Location trivially copyable am: 2e6f38af86 am: eadcf46ddc
am: 8f2179aca1 Change-Id: Iad92c870c78479e4ec57cbf0def6d4a1530a2c5c
-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.