OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5a6381
)
Fix some code to work if TargetLowering is not available.
author
Dan Gohman
<gohman@apple.com>
Fri, 1 May 2009 16:29:14 +0000
(16:29 +0000)
committer
Dan Gohman
<gohman@apple.com>
Fri, 1 May 2009 16:29:14 +0000
(16:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70546
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index
2dc6282
..
89429b6
100644
(file)
--- a/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@
-794,10
+794,14
@@
static bool fitsInAddressMode(const SCEVHandle &V, const Type *UseTy,
if (const SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))
if (GlobalValue *GV = dyn_cast<GlobalValue>(SU->getValue())) {
- TargetLowering::AddrMode AM;
- AM.BaseGV = GV;
- AM.HasBaseReg = HasBaseReg;
- return TLI->isLegalAddressingMode(AM, UseTy);
+ if (TLI) {
+ TargetLowering::AddrMode AM;
+ AM.BaseGV = GV;
+ AM.HasBaseReg = HasBaseReg;
+ return TLI->isLegalAddressingMode(AM, UseTy);
+ } else {
+ // Default: assume global addresses are not legal.
+ }
}
return false;