mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 22:07:27 +00:00
make isel use MO_PIC_BASE_OFFSET when lowering globalvalues on darwin in pic
mode, instead of having asmprinter just "know" to print them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
35c89618cf
commit
4c388b2c9d
@ -445,21 +445,17 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
else {
|
||||
HiddenGVStubs.insert(Name);
|
||||
printSuffixedName(Name, "$non_lazy_ptr");
|
||||
assert(MO.getTargetFlags() == 0);
|
||||
//assert(MO.getTargetFlags() == 0 || MO_PIC_BASE_OFFSET);
|
||||
}
|
||||
} else {
|
||||
GVStubs.insert(Name);
|
||||
printSuffixedName(Name, "$non_lazy_ptr");
|
||||
assert(MO.getTargetFlags() == 0);
|
||||
//assert(MO.getTargetFlags() == 0 || MO_PIC_BASE_OFFSET);
|
||||
}
|
||||
} else {
|
||||
O << Name;
|
||||
}
|
||||
|
||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||
O << '-';
|
||||
PrintPICBaseSymbol();
|
||||
}
|
||||
} else {
|
||||
O << Name;
|
||||
}
|
||||
|
@ -4575,6 +4575,9 @@ X86TargetLowering::LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl,
|
||||
OpFlags = X86II::MO_GOT;
|
||||
else
|
||||
OpFlags = X86II::MO_GOTOFF;
|
||||
} else if (Subtarget->isPICStyleStub() &&
|
||||
getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
||||
OpFlags = X86II::MO_PIC_BASE_OFFSET;
|
||||
}
|
||||
|
||||
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags);
|
||||
|
Loading…
Reference in New Issue
Block a user