diff options
author | Eric Christopher <echristo@apple.com> | 2010-01-08 21:37:11 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-01-08 21:37:11 +0000 |
commit | 4d1f58861d38f114e74d515ac1bd029e3a5a024f (patch) | |
tree | c61e4215c65d9f206e1e0565372451ac0fb8089a | |
parent | c8b3fce5c5f0785b05df9cf93772a67f56bc3640 (diff) | |
download | llvm-4d1f58861d38f114e74d515ac1bd029e3a5a024f.tar.gz llvm-4d1f58861d38f114e74d515ac1bd029e3a5a024f.tar.bz2 llvm-4d1f58861d38f114e74d515ac1bd029e3a5a024f.tar.xz |
Remove unnecessary dyn_cast and add a comment. Part of a WIP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93026 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index e34360087c..47c37c4658 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -633,12 +633,12 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { break; } case Intrinsic::objectsize: { - ConstantInt *Const = dyn_cast<ConstantInt>(II->getOperand(2)); - - if (!Const) return 0; - + ConstantInt *Const = cast<ConstantInt>(II->getOperand(2)); const Type *Ty = CI.getType(); + // 0 is maximum number of bytes left, 1 is minimum number of bytes left. + // TODO: actually add these values, the current return values are "don't + // know". if (Const->getZExtValue() == 0) return ReplaceInstUsesWith(CI, Constant::getAllOnesValue(Ty)); else |