From: Serge Guelton Date: Mon, 13 Nov 2017 21:40:57 +0000 (+0000) Subject: Fix -Werror when compiling rL318083 (bis) X-Git-Tag: llvmorg-6.0.0-rc1~3503 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3347332ad3ada61159f1a63f0f9cdb077004fde4;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h index f50f017..60a64c8 100644 --- a/llvm/include/llvm/IR/Value.h +++ b/llvm/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; } };