This transform requires valid TargetData info. Wrap it in 'if (TD)' in

preparation for the day we use null TargetData when no target is specified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2009-05-08 06:47:37 +00:00
parent 45e0010e14
commit 48f95ad971

View File

@ -11196,6 +11196,7 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
User *CI = cast<User>(LI.getOperand(0));
Value *CastOp = CI->getOperand(0);
if (TD) {
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(CI)) {
// Instead of loading constant c string, use corresponding integer value
// directly if string length is small enough.
@ -11227,6 +11228,7 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
}
}
}
}
const PointerType *DestTy = cast<PointerType>(CI->getType());
const Type *DestPTy = DestTy->getElementType();