Add constexpr annotations to LSEVisitor member functions.
Newer versions of clang rightly warn about LSEVisitor::Value::Equals
not being a constexpr function because it calls the non-constexpr
function LSEVisitor::IsValid(). Silence the warning by marking that
function and its callees as constexpr.
Change-Id: Ib3c36bd02232f8e465eac4eceabfa7ac069a634f
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index d74d1ef..7a81171 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -332,11 +332,11 @@
: ForNonLoopPhiPlaceholder(phi_placeholder);
}
- bool IsValid() const {
+ constexpr bool IsValid() const {
return !IsInvalid();
}
- bool IsInvalid() const {
+ constexpr bool IsInvalid() const {
return std::holds_alternative<ValuelessType>(value_) &&
GetValuelessType() == ValuelessType::kInvalid;
}
@@ -423,7 +423,7 @@
MergedUnknownMarker,
NeedsNonLoopPhiMarker,
NeedsLoopPhiMarker>;
- ValuelessType GetValuelessType() const {
+ constexpr ValuelessType GetValuelessType() const {
return std::get<ValuelessType>(value_);
}