ART: Make Location trivially copyable
Location is a ValueObject and should be trivially copyable. Move
copy constructor and copy assignment to default.
Add static assert.
Bug: 32619234
Test: m
Change-Id: I1ef8b65aafdbf84e3d4b7724b93f13936b590eba
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index da27928..52747c0 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -91,12 +91,9 @@
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 @@
LOG(FATAL) << "Should not use this location kind";
}
UNREACHABLE();
- return "?";
}
// Unallocated locations.