From da0e1ff5237ce9ed9c0c4fd76d2c25043676113f Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Mon, 13 Nov 2017 21:40:57 +0000 Subject: [PATCH] Fix -Werror when compiling rL318083 (bis) Statically assert the result and remove a runtime comparison, a direct consequence of the optimization introduced in rL318083. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318090 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Value.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/IR/Value.h b/include/llvm/IR/Value.h index f50f0172685..60a64c8ba8a 100644 --- a/include/llvm/IR/Value.h +++ b/include/llvm/IR/Value.h @@ -762,8 +762,8 @@ template void Value::sortUseList(Compare Cmp) { // template <> struct isa_impl { 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; } }; -- 2.11.0