Fix -Werror when compiling rL318083

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@318087 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Serge Guelton 2017-11-13 21:25:35 +00:00
parent cfcc1f1c64
commit 5aed538ef1

View File

@ -117,8 +117,8 @@ public:
//// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V) {
return V->getValueID() >= ConstantFirstVal &&
V->getValueID() <= ConstantLastVal;
static_assert(ConstantFirstVal == 0, "V->getValueID() >= ConstantFirstVal always succeeds");
return V->getValueID() <= ConstantLastVal;
}
/// This method is a special form of User::replaceUsesOfWith