llvm.org GIT mirror llvm / 59b34fe
don't call getNameWithPrefix repeatedly and unnecesarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93333 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
1 changed file(s) with 8 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
6868 void Init(const GlobalValue *GV, Mangler *Mang) {
6969 // Already initialized.
7070 if (!StubName.empty()) return;
71
72 // Get the names.
7173 StubName = Mang->getMangledName(GV, "$stub", true);
7274 LazyPtrName = Mang->getMangledName(GV, "$lazy_ptr", true);
7375 AnonSymbolName = Mang->getMangledName(GV, "$stub$tmp", true);
8082 SmallString<128> TmpStr;
8183 Mang->getNameWithPrefix(TmpStr, GVName + "$stub", Mangler::Private);
8284 StubSym = Ctx.GetOrCreateSymbol(TmpStr.str());
83 TmpStr.clear();
85 TmpStr.erase(TmpStr.end()-5, TmpStr.end()); // Remove $stub
86
87 TmpStr += "$lazy_ptr";
88 LazyPtrSym = Ctx.GetOrCreateSymbol(TmpStr.str());
89 TmpStr.erase(TmpStr.end()-9, TmpStr.end()); // Remove $lazy_ptr
8490
85 Mang->getNameWithPrefix(TmpStr, GVName + "$lazy_ptr", Mangler::Private);
86 LazyPtrSym = Ctx.GetOrCreateSymbol(TmpStr.str());
87 TmpStr.clear();
88
89 Mang->getNameWithPrefix(TmpStr, GVName + "$stub$tmp", Mangler::Private);
91 TmpStr += "$stub$tmp";
9092 AnonSymbolSym = Ctx.GetOrCreateSymbol(TmpStr.str());
9193 }
9294