summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-19 23:38:22 +0000
committerDan Gohman <gohman@apple.com>2009-08-19 23:38:22 +0000
commit7167f427694b55c98f4e6cd1173ab136af3bc705 (patch)
tree0165b4167f499777cd4eef1e7812cb6bd7bc2767 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parentcb13b4896999dce4be3e279f61570cbc36d19c1d (diff)
downloadbcm5719-llvm-7167f427694b55c98f4e6cd1173ab136af3bc705.tar.gz
bcm5719-llvm-7167f427694b55c98f4e6cd1173ab136af3bc705.zip
Fix a few places to check if TargetData is available before using it.
llvm-svn: 79493
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 7a98b482a2e..5fe8ee876c3 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -478,9 +478,9 @@ isEliminableCastPair(
// We don't want to form an inttoptr or ptrtoint that converts to an integer
// type that differs from the pointer size.
if ((Res == Instruction::IntToPtr &&
- SrcTy != TD->getIntPtrType(CI->getContext())) ||
+ (!TD || SrcTy != TD->getIntPtrType(CI->getContext()))) ||
(Res == Instruction::PtrToInt &&
- DstTy != TD->getIntPtrType(CI->getContext())))
+ (!TD || DstTy != TD->getIntPtrType(CI->getContext()))))
Res = 0;
return Instruction::CastOps(Res);
OpenPOWER on IntegriCloud