summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-01-08 21:37:11 +0000
committerEric Christopher <echristo@apple.com>2010-01-08 21:37:11 +0000
commit4a1d7e1506855a0ad943a675ab208743f74c046b (patch)
tree204c725eaba8f3d326e126d7c612b493d699eb5c /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
parent9242ae047c4c061c0501d626e5e372f11b5877bc (diff)
downloadbcm5719-llvm-4a1d7e1506855a0ad943a675ab208743f74c046b.tar.gz
bcm5719-llvm-4a1d7e1506855a0ad943a675ab208743f74c046b.zip
Remove unnecessary dyn_cast and add a comment. Part of a WIP.
llvm-svn: 93026
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index e34360087c6..47c37c46587 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud