[llvm-commits] [llvm] r93026 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
Eric Christopher
echristo at apple.com
Fri Jan 8 13:37:11 PST 2010
Author: echristo
Date: Fri Jan 8 15:37:11 2010
New Revision: 93026
URL: http://llvm.org/viewvc/llvm-project?rev=93026&view=rev
Log:
Remove unnecessary dyn_cast and add a comment. Part of a WIP.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=93026&r1=93025&r2=93026&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Fri Jan 8 15:37:11 2010
@@ -633,12 +633,12 @@
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
More information about the llvm-commits
mailing list