aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-19 18:49:14 +0000
committerChris Lattner <sabre@nondot.org>2009-10-19 18:49:14 +0000
commit1c7f8d32d6edd39000fbb2643828d86d2235b139 (patch)
treea56b8a6972fd9065e25e1007b7d2272ade99ebe5 /lib
parentd9a6f16cfc733a242378b2bd57f744e46f88fed5 (diff)
downloadexternal_llvm-1c7f8d32d6edd39000fbb2643828d86d2235b139.zip
external_llvm-1c7f8d32d6edd39000fbb2643828d86d2235b139.tar.gz
external_llvm-1c7f8d32d6edd39000fbb2643828d86d2235b139.tar.bz2
simplify code, reducing string thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 32a8f5e..6d4a05f 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -157,26 +157,16 @@ namespace {
// FIXME: Remove this when Darwin transition to @GOT like syntax.
Name = Mang->getMangledName(GV, "$non_lazy_ptr", true);
MCSymbol *Sym = OutContext.GetOrCreateSymbol(Name.c_str());
-
- if (GV->hasHiddenVisibility()) {
- const MCSymbol *&StubSym =
- MMI->getObjFileInfo<MachineModuleInfoMachO>()
- .getHiddenGVStubEntry(Sym);
- if (StubSym == 0) {
- //NameStr.clear();
- //Mang->getNameWithPrefix(NameStr, GV, false);
- std::string SymName = Mang->getMangledName(GV);
- StubSym = OutContext.GetOrCreateSymbol(SymName.c_str());
- }
- } else {
- const MCSymbol *&StubSym =
- MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(Sym);
- if (StubSym == 0) {
- //NameStr.clear();
- //Mang->getNameWithPrefix(NameStr, GV, false);
- std::string SymName = Mang->getMangledName(GV);
- StubSym = OutContext.GetOrCreateSymbol(SymName.c_str());
- }
+
+ MachineModuleInfoMachO &MMIMachO =
+ MMI->getObjFileInfo<MachineModuleInfoMachO>();
+ const MCSymbol *&StubSym =
+ GV->hasHiddenVisibility() ? MMIMachO.getHiddenGVStubEntry(Sym) :
+ MMIMachO.getGVStubEntry(Sym);
+ if (StubSym == 0) {
+ SmallString<128> NameStr;
+ Mang->getNameWithPrefix(NameStr, GV, false);
+ StubSym = OutContext.GetOrCreateSymbol(NameStr.str());
}
}
} else