diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-09-15 17:56:51 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-09-15 17:56:51 +0000 |
commit | 6941785e1b1c435001eae38fe87be464d9bc7bb0 (patch) | |
tree | cd789e74882ddcb1788d5f345abb12bebffc092c /llvm/lib/IR/Instructions.cpp | |
parent | 735152e3b0f2ddb37f1c540a74a4b4f007225cb6 (diff) | |
download | bcm5719-llvm-6941785e1b1c435001eae38fe87be464d9bc7bb0.tar.gz bcm5719-llvm-6941785e1b1c435001eae38fe87be464d9bc7bb0.zip |
Use dyn_cast<> instead of isa<> and cast<>
llvm-svn: 217796
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index be32dee0638..1497aa885c5 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/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<ConstantInt>(val) && cast<ConstantInt>(val)->isOne(); + const ConstantInt *CVal = dyn_cast<ConstantInt>(val); + return CVal && CVal->isOne(); } static Instruction *createMalloc(Instruction *InsertBefore, |