1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Use dyn_cast<> instead of isa<> and cast<>

llvm-svn: 217796
This commit is contained in:
Matt Arsenault 2014-09-15 17:56:51 +00:00
parent 64e655bce4
commit c293d239a5

View File

@ -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<ConstantInt>(val) && cast<ConstantInt>(val)->isOne();
const ConstantInt *CVal = dyn_cast<ConstantInt>(val);
return CVal && CVal->isOne();
}
static Instruction *createMalloc(Instruction *InsertBefore,