forked from OSchip/llvm-project
make isel use MO_PIC_BASE_OFFSET when lowering globalvalues on darwin in pic
mode, instead of having asmprinter just "know" to print them. llvm-svn: 75109
This commit is contained in:
parent
0667b145c4
commit
e0dae0e716
|
@ -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