mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Fix some code to work if TargetLowering is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70546 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d5a6381195
commit
cc2ad058b3
@ -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())) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user