Fix -Werror when compiling rL318083 (bis)

Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.

llvm-svn: 318090
This commit is contained in:
Serge Guelton 2017-11-13 21:40:57 +00:00
parent fba6547f2a
commit 3347332ad3
1 changed files with 2 additions and 2 deletions

View File

@ -762,8 +762,8 @@ template <class Compare> void Value::sortUseList(Compare Cmp) {
//
template <> struct isa_impl<Constant, Value> {
static inline bool doit(const Value &Val) {
return Val.getValueID() >= Value::ConstantFirstVal &&
Val.getValueID() <= Value::ConstantLastVal;
static_assert(Value::ConstantFirstVal == 0, "Val.getValueID() >= Value::ConstantFirstVal");
return Val.getValueID() <= Value::ConstantLastVal;
}
};