diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-15 23:26:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-15 23:26:49 +0000 |
| commit | 3ec04731eb45adb6622a62456d1bc605711c5f42 (patch) | |
| tree | 781ed8fc4612c1f7cfc740167388eef551da6848 /lib/Target | |
| parent | f7871d1b5018aae518bed4cd979130d2cf06ad02 (diff) | |
| download | external_llvm-3ec04731eb45adb6622a62456d1bc605711c5f42.zip external_llvm-3ec04731eb45adb6622a62456d1bc605711c5f42.tar.gz external_llvm-3ec04731eb45adb6622a62456d1bc605711c5f42.tar.bz2 | |
mc'ize a bunch of symbol stuff, eliminating std::strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
| -rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 7e62619..bcec896 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -184,27 +184,24 @@ namespace { } else if (ACPV->isBlockAddress()) { O << GetBlockAddressSymbol(ACPV->getBlockAddress())->getName(); } else if (ACPV->isGlobalValue()) { - std::string Name; GlobalValue *GV = ACPV->getGV(); bool isIndirect = Subtarget->isTargetDarwin() && Subtarget->GVIsIndirectSymbol(GV, TM.getRelocationModel()); if (!isIndirect) - Name = Mang->getMangledName(GV); + GetGlobalValueSymbol(GV)->print(O, MAI); else { // FIXME: Remove this when Darwin transition to @GOT like syntax. - Name = Mang->getMangledName(GV, "$non_lazy_ptr", true); - MCSymbol *Sym = OutContext.GetOrCreateSymbol(StringRef(Name)); + MCSymbol *Sym = GetPrivateGlobalValueSymbolStub(GV, "$non_lazy_ptr"); + Sym->print(O, MAI); MachineModuleInfoMachO &MMIMachO = MMI->getObjFileInfo<MachineModuleInfoMachO>(); const MCSymbol *&StubSym = GV->hasHiddenVisibility() ? MMIMachO.getHiddenGVStubEntry(Sym) : MMIMachO.getGVStubEntry(Sym); - if (StubSym == 0) { + if (StubSym == 0) StubSym = GetGlobalValueSymbol(GV); - } } - O << Name; } else { assert(ACPV->isExtSymbol() && "unrecognized constant pool value"); GetExternalSymbolSymbol(ACPV->getSymbol())->print(O, MAI); @@ -217,9 +214,9 @@ namespace { << "+" << (unsigned)ACPV->getPCAdjustment(); if (ACPV->mustAddCurrentAddress()) O << "-."; - O << ")"; + O << ')'; } - O << "\n"; + O << '\n'; } void getAnalysisUsage(AnalysisUsage &AU) const { @@ -379,7 +376,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum, else if ((Modifier && strcmp(Modifier, "hi16") == 0) || (TF & ARMII::MO_HI16)) O << ":upper16:"; - O << Mang->getMangledName(GV); + GetGlobalValueSymbol(GV)->print(O, MAI); printOffset(MO.getOffset()); @@ -1225,10 +1222,10 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { if (isDarwin) { if (GVar->hasLocalLinkage()) { - O << MAI->getLCOMMDirective() << name << "," << Size + O << MAI->getLCOMMDirective() << name << ',' << Size << ',' << Align; } else if (GVar->hasCommonLinkage()) { - O << MAI->getCOMMDirective() << name << "," << Size + O << MAI->getCOMMDirective() << name << ',' << Size << ',' << Align; } else { OutStreamer.SwitchSection(TheSection); |
