simplify code, reducing string thrashing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-10-19 18:49:14 +00:00
parent e4d9ea83c0
commit b8f64a72d8

View File

@ -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