[llvm-commits] [llvm] r84521 - /llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 19 11:49:15 PDT 2009
Author: lattner
Date: Mon Oct 19 13:49:14 2009
New Revision: 84521
URL: http://llvm.org/viewvc/llvm-project?rev=84521&view=rev
Log:
simplify code, reducing string thrashing.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=84521&r1=84520&r2=84521&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Oct 19 13:49:14 2009
@@ -157,26 +157,16 @@
// 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
More information about the llvm-commits
mailing list