mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
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
This commit is contained in:
parent
c8b3fce5c5
commit
4d1f58861d
@ -633,12 +633,12 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Intrinsic::objectsize: {
|
case Intrinsic::objectsize: {
|
||||||
ConstantInt *Const = dyn_cast<ConstantInt>(II->getOperand(2));
|
ConstantInt *Const = cast<ConstantInt>(II->getOperand(2));
|
||||||
|
|
||||||
if (!Const) return 0;
|
|
||||||
|
|
||||||
const Type *Ty = CI.getType();
|
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)
|
if (Const->getZExtValue() == 0)
|
||||||
return ReplaceInstUsesWith(CI, Constant::getAllOnesValue(Ty));
|
return ReplaceInstUsesWith(CI, Constant::getAllOnesValue(Ty));
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user