[llvm-commits] [llvm] r75733 - in /llvm/trunk: lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp test/CodeGen/PowerPC/available-externally.ll

Chris Lattner sabre at nondot.org
Tue Jul 14 19:56:53 PDT 2009


Author: lattner
Date: Tue Jul 14 21:56:53 2009
New Revision: 75733

URL: http://llvm.org/viewvc/llvm-project?rev=75733&view=rev
Log:
get the PPC stub temporary label from the mangler instead of 
using horrible string hacking.  This gives us a different label,
but it's just an assembler temporary, so the name doesn't matter.

Modified:
    llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
    llvm/trunk/test/CodeGen/PowerPC/available-externally.ll

Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=75733&r1=75732&r2=75733&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue Jul 14 21:56:53 2009
@@ -989,41 +989,17 @@
          I != E; ++I) {
       EmitAlignment(4);
       const FnStubInfo &Info = I->second;
-      const char *p = I->getKeyData();
-      
-      bool hasQuote = p[0]=='\"';
       O << Info.Stub << ":\n";
       O << "\t.indirect_symbol " << I->getKeyData() << '\n';
       O << "\tmflr r0\n";
-      O << "\tbcl 20,31,";
-      if (hasQuote)
-        O << "\"L0$" << &p[1];
-      else
-        O << "L0$" << p;
-      O << '\n';
-      if (hasQuote)
-        O << "\"L0$" << &p[1];
-      else
-        O << "L0$" << p;
-      O << ":\n";
+      O << "\tbcl 20,31," << Info.AnonSymbol << '\n';
+      O << Info.AnonSymbol << ":\n";
       O << "\tmflr r11\n";
-      O << "\taddis r11,r11,ha16(" << Info.LazyPtr << "-";
-      if (hasQuote)
-        O << "\"L0$" << &p[1];
-      else
-        O << "L0$" << p;
+      O << "\taddis r11,r11,ha16(" << Info.LazyPtr << "-" << Info.AnonSymbol;
       O << ")\n";
       O << "\tmtlr r0\n";
-      if (isPPC64)
-        O << "\tldu r12,lo16(";
-      else
-        O << "\tlwzu r12,lo16(";
-      O << Info.LazyPtr << "-";
-      if (hasQuote)
-        O << "\"L0$" << &p[1];
-      else
-        O << "L0$" << p;
-      O << ")(r11)\n";
+      O << (isPPC64 ? "\tldu" : "\tlwzu") << " r12,lo16(";
+      O << Info.LazyPtr << "-" << Info.AnonSymbol << ")(r11)\n";
       O << "\tmtctr r12\n";
       O << "\tbctr\n";
       SwitchToDataSection(".lazy_symbol_pointer");

Modified: llvm/trunk/test/CodeGen/PowerPC/available-externally.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/available-externally.ll?rev=75733&r1=75732&r2=75733&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/available-externally.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/available-externally.ll Tue Jul 14 21:56:53 2009
@@ -34,13 +34,13 @@
 ; PIC: L_exact_log2$stub:
 ; PIC: .indirect_symbol _exact_log2
 ; PIC: mflr r0
-; PIC: bcl 20,31,L0$_exact_log2
+; PIC: bcl 20,31,L_exact_log2$stub$tmp
 
-; PIC: L0$_exact_log2:
+; PIC: L_exact_log2$stub$tmp:
 ; PIC: mflr r11
-; PIC: addis r11,r11,ha16(L_exact_log2$lazy_ptr-L0$_exact_log2)
+; PIC: addis r11,r11,ha16(L_exact_log2$lazy_ptr-L_exact_log2$stub$tmp)
 ; PIC: mtlr r0
-; PIC: lwzu r12,lo16(L_exact_log2$lazy_ptr-L0$_exact_log2)(r11)
+; PIC: lwzu r12,lo16(L_exact_log2$lazy_ptr-L_exact_log2$stub$tmp)(r11)
 ; PIC: mtctr r12
 ; PIC: bctr
 





More information about the llvm-commits mailing list