summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-15 02:56:53 +0000
committerChris Lattner <sabre@nondot.org>2009-07-15 02:56:53 +0000
commit392db3e11d93990e5c8382776b91d73ef40db005 (patch)
treec7829bed835546593cb62389f57bc45a73effe64 /lib/Target
parent1a87c05ec011eaccb950e5f0160e2162e5747553 (diff)
downloadllvm-392db3e11d93990e5c8382776b91d73ef40db005.tar.gz
llvm-392db3e11d93990e5c8382776b91d73ef40db005.tar.bz2
llvm-392db3e11d93990e5c8382776b91d73ef40db005.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp34
1 files changed, 5 insertions, 29 deletions
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 09c58a29c2..7489e49ca5 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -989,41 +989,17 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
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");