summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-13 06:38:18 +0000
committerChris Lattner <sabre@nondot.org>2010-01-13 06:38:18 +0000
commit209aecad0c8693ea11db269e6d0f020c71958a62 (patch)
treed996c9b540cf3a392b5e03579530ae787fb71f36 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent64eecd2de5c5edd309eb52961a4dbf8fe1b0446a (diff)
downloadbcm5719-llvm-209aecad0c8693ea11db269e6d0f020c71958a62.tar.gz
bcm5719-llvm-209aecad0c8693ea11db269e6d0f020c71958a62.zip
change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string. Based on this change: 1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef 2. Change a bunch of targets to call makeNameProper with a smallstring, making several of them *much* more efficient. 3. Rewrite Mangler::makeNameProper to not build names and then prepend prefixes, not use temporary std::strings, and to avoid other crimes. llvm-svn: 93298
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 96019bf7326..b1957bb0da2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1679,13 +1679,14 @@ MCSymbol *AsmPrinter::GetBlockAddressSymbol(const Function *F,
// functions.
std::string FuncName = Mang->getMangledName(F);
- SmallString<60> Name;
- raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() << "BA"
- << FuncName.size() << '_' << FuncName << '_'
- << Mang->makeNameProper(BB->getName())
- << Suffix;
-
- return OutContext.GetOrCreateSymbol(Name.str());
+ SmallString<60> NameResult;
+ raw_svector_ostream(NameResult) << MAI->getPrivateGlobalPrefix() << "BA"
+ << FuncName.size() << '_' << FuncName << '_';
+ Mang->makeNameProper(NameResult, BB->getName());
+ if (Suffix[0])
+ NameResult += Suffix;
+
+ return OutContext.GetOrCreateSymbol(NameResult.str());
}
MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
OpenPOWER on IntegriCloud