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 | 5bf742f2aab7ad4370f867bb8e90230c61412d17 (patch) | |
tree | 2c77ad6e678099b91f93ee0d8308940bd9752cfd /llvm/lib/Target/ARM/ARMAsmPrinter.cpp | |
parent | ca8da1d89da6961e0b4c7c296c43649c41e053e5 (diff) | |
download | bcm5719-llvm-5bf742f2aab7ad4370f867bb8e90230c61412d17.tar.gz bcm5719-llvm-5bf742f2aab7ad4370f867bb8e90230c61412d17.zip |
Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.
llvm-svn: 51277
Diffstat (limited to 'llvm/lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index ed7077129c7..e850ef1983b 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/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"; } |