aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-13 19:05:36 +0000
committerChris Lattner <sabre@nondot.org>2010-01-13 19:05:36 +0000
commit59b34fe55fc2aaec2ebc9fd8e62a96e3686fa5c3 (patch)
treec9837c5e67e44e29406cc916b8bed279c26b9f75
parent0b4bad54f64944880eca9331fbb34545adbe7833 (diff)
don't call getNameWithPrefix repeatedly and unnecesarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93333 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 93019d067c..da29572676 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -69,6 +69,8 @@ namespace {
void Init(const GlobalValue *GV, Mangler *Mang) {
// Already initialized.
if (!StubName.empty()) return;
+
+ // Get the names.
StubName = Mang->getMangledName(GV, "$stub", true);
LazyPtrName = Mang->getMangledName(GV, "$lazy_ptr", true);
AnonSymbolName = Mang->getMangledName(GV, "$stub$tmp", true);
@@ -81,13 +83,13 @@ namespace {
SmallString<128> TmpStr;
Mang->getNameWithPrefix(TmpStr, GVName + "$stub", Mangler::Private);
StubSym = Ctx.GetOrCreateSymbol(TmpStr.str());
- TmpStr.clear();
-
- Mang->getNameWithPrefix(TmpStr, GVName + "$lazy_ptr", Mangler::Private);
+ TmpStr.erase(TmpStr.end()-5, TmpStr.end()); // Remove $stub
+
+ TmpStr += "$lazy_ptr";
LazyPtrSym = Ctx.GetOrCreateSymbol(TmpStr.str());
- TmpStr.clear();
+ TmpStr.erase(TmpStr.end()-9, TmpStr.end()); // Remove $lazy_ptr
- Mang->getNameWithPrefix(TmpStr, GVName + "$stub$tmp", Mangler::Private);
+ TmpStr += "$stub$tmp";
AnonSymbolSym = Ctx.GetOrCreateSymbol(TmpStr.str());
}