[llvm-commits] [llvm] r75109 - in /llvm/trunk/lib/Target/X86: AsmPrinter/X86ATTAsmPrinter.cpp X86ISelLowering.cpp
Chris Lattner
sabre at nondot.org
Wed Jul 8 22:47:34 PDT 2009
Author: lattner
Date: Thu Jul 9 00:47:33 2009
New Revision: 75109
URL: http://llvm.org/viewvc/llvm-project?rev=75109&view=rev
Log:
make isel use MO_PIC_BASE_OFFSET when lowering globalvalues on darwin in pic
mode, instead of having asmprinter just "know" to print them.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=75109&r1=75108&r2=75109&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jul 9 00:47:33 2009
@@ -445,21 +445,17 @@
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;
}
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=75109&r1=75108&r2=75109&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jul 9 00:47:33 2009
@@ -4575,6 +4575,9 @@
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);
More information about the llvm-commits
mailing list