projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5149932
)
Fix a few places to check if TargetData is available before using it.
author
Dan Gohman
<gohman@apple.com>
Wed, 19 Aug 2009 23:38:22 +0000
(23:38 +0000)
committer
Dan Gohman
<gohman@apple.com>
Wed, 19 Aug 2009 23:38:22 +0000
(23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79493
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index 7a98b482a2ec9ac4966a01297cb0fdbefe41bf29..5fe8ee876c345a42671c05ff232b949fbf9f9ee7 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
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);