[llvm-commits] [llvm] r74186 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Thu Jun 25 10:58:52 PDT 2009
Author: lattner
Date: Thu Jun 25 12:58:52 2009
New Revision: 74186
URL: http://llvm.org/viewvc/llvm-project?rev=74186&view=rev
Log:
simplify shouldPrintPLT
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.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=74186&r1=74185&r2=74186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jun 25 12:58:52 2009
@@ -295,8 +295,7 @@
}
static inline bool shouldPrintPLT(TargetMachine &TM, const X86Subtarget* ST) {
- return ST->isTargetELF() && TM.getRelocationModel() == Reloc::PIC_ &&
- (ST->isPICStyleRIPRel() || ST->isPICStyleGOT());
+ return ST->isTargetELF() && TM.getRelocationModel() == Reloc::PIC_;
}
static inline bool shouldPrintStub(TargetMachine &TM, const X86Subtarget* ST) {
@@ -331,6 +330,8 @@
}
if (shouldPrintStub(TM, Subtarget)) {
+ // DARWIN/X86-32 in != static mode.
+
// Link-once, declaration, or Weakly-linked global variables need
// non-lazily-resolved stubs
if (GV->isDeclaration() || GV->isWeakForLinker()) {
@@ -361,9 +362,8 @@
O << Name;
}
} else {
- if (GV->hasDLLImportLinkage()) {
+ if (GV->hasDLLImportLinkage())
O << "__imp_";
- }
O << Name;
if (shouldPrintPLT(TM, Subtarget)) {
@@ -390,7 +390,9 @@
Name += MO.getSymbolName();
// Print function stub suffix unless it's Mac OS X 10.5 and up.
if (shouldPrintStub(TM, Subtarget) &&
+ // DARWIN/X86-32 in != static mode.
!(Subtarget->isTargetDarwin() && Subtarget->getDarwinVers() >= 9)) {
+
FnStubs.insert(Name);
printSuffixedName(Name, "$stub");
return;
@@ -514,6 +516,8 @@
}
if (shouldPrintStub(TM, Subtarget)) {
+ // DARWIN/X86-32 in != static mode.
+
// Link-once, declaration, or Weakly-linked global variables need
// non-lazily-resolved stubs
if (GV->isDeclaration() || GV->isWeakForLinker()) {
More information about the llvm-commits
mailing list