[llvm] r318090 - Fix -Werror when compiling rL318083 (bis)
Serge Guelton via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 13:40:57 PST 2017
Author: serge_sans_paille
Date: Mon Nov 13 13:40:57 2017
New Revision: 318090
URL: http://llvm.org/viewvc/llvm-project?rev=318090&view=rev
Log:
Fix -Werror when compiling rL318083 (bis)
Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083.
Modified:
llvm/trunk/include/llvm/IR/Value.h
Modified: llvm/trunk/include/llvm/IR/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Value.h?rev=318090&r1=318089&r2=318090&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Value.h (original)
+++ llvm/trunk/include/llvm/IR/Value.h Mon Nov 13 13:40:57 2017
@@ -762,8 +762,8 @@ template <class Compare> void Value::sor
//
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;
}
};
More information about the llvm-commits
mailing list