diff options
| author | 2016-11-04 19:37:37 +0000 | |
|---|---|---|
| committer | 2016-11-04 19:37:37 +0000 | |
| commit | ef36dce429b41e96ea85f33b6bf05f03288601da (patch) | |
| tree | 25d7b9ddc610c868f8021dcca287d53a586dd3c4 | |
| parent | 5f892500c74b06b9a4a467beafc7536c0c95801a (diff) | |
| parent | 8f2179aca19e251cf5bc7ee4922d2a043aa2105c (diff) | |
ART: Make Location trivially copyable am: 2e6f38af86 am: eadcf46ddc
am: 8f2179aca1
Change-Id: Iad92c870c78479e4ec57cbf0def6d4a1530a2c5c
| -rw-r--r-- | compiler/optimizing/locations.cc | 5 | ||||
| -rw-r--r-- | compiler/optimizing/locations.h | 8 |
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. |