diff --git a/include/llvm/IR/Constant.h b/include/llvm/IR/Constant.h index 9daeac6ad6e..0c94b58a311 100644 --- a/include/llvm/IR/Constant.h +++ b/include/llvm/IR/Constant.h @@ -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