diff options
author | Dale Johannesen <dalej@apple.com> | 2008-05-19 21:38:18 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-05-19 21:38:18 +0000 |
commit | c215b3ef5d9627f5fb6fe9034e46bc29ae592916 (patch) | |
tree | 4c9eed2f1deea199d388cce1b02a4b3e081a71cf /lib/Target/ARM/ARMAsmPrinter.cpp | |
parent | 7be1c454c96dc5fa41ac10d014f76350df94f9cf (diff) |
Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index ed7077129c..e850ef1983 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -127,10 +127,10 @@ namespace { Name += ACPV->getSymbol(); if (ACPV->isNonLazyPointer()) { GVNonLazyPtrs.insert(Name); - O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; + printSuffixedName(Name, "$non_lazy_ptr"); } else if (ACPV->isStub()) { FnStubs.insert(Name); - O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; + printSuffixedName(Name, "$stub"); } else O << Name; if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; @@ -295,7 +295,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum, GV->hasLinkOnceLinkage()); if (isExt && isCallOp && Subtarget->isTargetDarwin() && TM.getRelocationModel() != Reloc::Static) { - O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; + printSuffixedName(Name, "$stub"); FnStubs.insert(Name); } else O << Name; @@ -318,7 +318,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum, Name += MO.getSymbolName(); if (isCallOp && Subtarget->isTargetDarwin() && TM.getRelocationModel() != Reloc::Static) { - O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; + printSuffixedName(Name, "$stub"); FnStubs.insert(Name); } else O << Name; @@ -1004,21 +1004,32 @@ bool ARMAsmPrinter::doFinalization(Module &M) { EmitAlignment(2); O << "\t.code\t32\n"; - O << "L" << *i << "$stub:\n"; + std::string p = *i; + printSuffixedName(p, "$stub"); + O << ":\n"; O << "\t.indirect_symbol " << *i << "\n"; - O << "\tldr ip, L" << *i << "$slp\n"; + O << "\tldr ip, "; + printSuffixedName(p, "$slp"); + O << "\n"; if (TM.getRelocationModel() == Reloc::PIC_) { - O << "L" << *i << "$scv:\n"; + printSuffixedName(p, "$scv"); + O << ":\n"; O << "\tadd ip, pc, ip\n"; } O << "\tldr pc, [ip, #0]\n"; - O << "L" << *i << "$slp:\n"; - if (TM.getRelocationModel() == Reloc::PIC_) - O << "\t.long\tL" << *i << "$lazy_ptr-(L" << *i << "$scv+8)\n"; - else - O << "\t.long\tL" << *i << "$lazy_ptr\n"; + printSuffixedName(p, "$slp"); + O << ":\n"; + O << "\t.long\t"; + printSuffixedName(p, "$lazy_ptr"); + if (TM.getRelocationModel() == Reloc::PIC_) { + O << "-("; + printSuffixedName(p, "$scv"); + O << "+8)\n"; + } else + O << "\n"; SwitchToDataSection(".lazy_symbol_pointer", 0); - O << "L" << *i << "$lazy_ptr:\n"; + printSuffixedName(p, "$lazy_ptr"); + O << ":\n"; O << "\t.indirect_symbol " << *i << "\n"; O << "\t.long\tdyld_stub_binding_helper\n"; } @@ -1029,7 +1040,9 @@ bool ARMAsmPrinter::doFinalization(Module &M) { SwitchToDataSection(".non_lazy_symbol_pointer", 0); for (std::set<std::string>::iterator i = GVNonLazyPtrs.begin(), e = GVNonLazyPtrs.end(); i != e; ++i) { - O << "L" << *i << "$non_lazy_ptr:\n"; + std::string p = *i; + printSuffixedName(p, "$non_lazy_ptr"); + O << ":\n"; O << "\t.indirect_symbol " << *i << "\n"; O << "\t.long\t0\n"; } |