From 38483c5e48e5f75cbfe38b51c7e5435d9da66272 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. llvm-svn: 318090 --- 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; } };