[llvm-commits] [llvm] r81685 - in /llvm/trunk/lib/Target/X86/AsmPrinter: X86ATTAsmPrinter.cpp X86MCInstLower.h

Chris Lattner sabre at nondot.org
Sun Sep 13 11:34:01 PDT 2009


Author: lattner
Date: Sun Sep 13 13:33:59 2009
New Revision: 81685

URL: http://llvm.org/viewvc/llvm-project?rev=81685&view=rev
Log:
make X86ATTAsmPrinter::PrintPICBaseSymbol forward to X86MCInstLower.

Modified:
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.h

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=81685&r1=81684&r2=81685&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Sun Sep 13 13:33:59 2009
@@ -15,6 +15,7 @@
 
 #define DEBUG_TYPE "asm-printer"
 #include "X86ATTAsmPrinter.h"
+#include "X86MCInstLower.h"
 #include "X86.h"
 #include "X86COFF.h"
 #include "X86MachineFunctionInfo.h"
@@ -46,14 +47,9 @@
 //===----------------------------------------------------------------------===//
 
 void X86ATTAsmPrinter::PrintPICBaseSymbol() const {
-  // FIXME: the actual label generated doesn't matter here!  Just mangle in
-  // something unique (the function number) with Private prefix.
-  if (Subtarget->isTargetDarwin())
-    O << "\"L" << getFunctionNumber() << "$pb\"";
-  else {
-    assert(Subtarget->isTargetELF() && "Don't know how to print PIC label!");
-    O << ".Lllvm$" << getFunctionNumber() << ".$piclabel";
-  }
+  // FIXME: Gross const cast hack.
+  X86ATTAsmPrinter *AP = const_cast<X86ATTAsmPrinter*>(this);
+  X86MCInstLower(OutContext, 0, *AP).GetPICBaseSymbol()->print(O, MAI);
 }
 
 static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.h?rev=81685&r1=81684&r2=81685&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.h (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.h Sun Sep 13 13:33:59 2009
@@ -10,6 +10,8 @@
 #ifndef X86_MCINSTLOWER_H
 #define X86_MCINSTLOWER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
   class MCContext;
   class MCInst;
@@ -22,7 +24,7 @@
   class X86Subtarget;
   
 /// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
-class X86MCInstLower {
+class VISIBILITY_HIDDEN X86MCInstLower {
   MCContext &Ctx;
   Mangler *Mang;
   X86ATTAsmPrinter &AsmPrinter;





More information about the llvm-commits mailing list