From: Matt Arsenault Date: Mon, 15 Sep 2014 17:56:51 +0000 (+0000) Subject: Use dyn_cast<> instead of isa<> and cast<> X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=744742602a20aeacea2af778dd873cd39ef099aa;p=oota-llvm.git Use dyn_cast<> instead of isa<> and cast<> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217796 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index be32dee0638..1497aa885c5 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -365,7 +365,8 @@ bool CallInst::paramHasAttr(unsigned i, Attribute::AttrKind A) const { /// IsConstantOne - Return true only if val is constant int 1 static bool IsConstantOne(Value *val) { assert(val && "IsConstantOne does not work with NULL val"); - return isa(val) && cast(val)->isOne(); + const ConstantInt *CVal = dyn_cast(val); + return CVal && CVal->isOne(); } static Instruction *createMalloc(Instruction *InsertBefore,