forked from OSchip/llvm-project
Fix some code to work if TargetLowering is not available.
llvm-svn: 70546
This commit is contained in:
parent
afbff15e64
commit
6be8530158
|
@ -794,10 +794,14 @@ static bool fitsInAddressMode(const SCEVHandle &V, const Type *UseTy,
|
||||||
|
|
||||||
if (const SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))
|
if (const SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))
|
||||||
if (GlobalValue *GV = dyn_cast<GlobalValue>(SU->getValue())) {
|
if (GlobalValue *GV = dyn_cast<GlobalValue>(SU->getValue())) {
|
||||||
|
if (TLI) {
|
||||||
TargetLowering::AddrMode AM;
|
TargetLowering::AddrMode AM;
|
||||||
AM.BaseGV = GV;
|
AM.BaseGV = GV;
|
||||||
AM.HasBaseReg = HasBaseReg;
|
AM.HasBaseReg = HasBaseReg;
|
||||||
return TLI->isLegalAddressingMode(AM, UseTy);
|
return TLI->isLegalAddressingMode(AM, UseTy);
|
||||||
|
} else {
|
||||||
|
// Default: assume global addresses are not legal.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue