aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-08 00:55:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-08 00:55:58 +0000
commit77c8f7674db1a3c57fa9d8916957a01f9961ef9c (patch)
tree90ccf90964af2b7e3eaf73f68a25e879fd4a9d84 /lib/CodeGen/AsmPrinter.cpp
parent82eec45b00ae42c6221e6e8d7886c36cc75b1efb (diff)
Avoid unnecessary string construction during asm printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 35c3671980..3f89792053 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -1377,7 +1377,7 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
O << ':';
if (printComment && MBB->getBasicBlock())
O << '\t' << TAI->getCommentString() << ' '
- << MBB->getBasicBlock()->getName();
+ << MBB->getBasicBlock()->getNameStart();
}
/// printPICJumpTableSetLabel - This method prints a set label for the
@@ -1445,10 +1445,14 @@ void AsmPrinter::printDataDirective(const Type *type) {
}
}
-void AsmPrinter::printSuffixedName(std::string &Name, const char* Suffix) {
+void AsmPrinter::printSuffixedName(const char *Name, const char* Suffix) {
if (Name[0]=='\"')
O << '\"' << TAI->getPrivateGlobalPrefix() <<
- Name.substr(1, Name.length()-2) << Suffix << '\"';
+ Name[1] << Suffix << '\"';
else
O << TAI->getPrivateGlobalPrefix() << Name << Suffix;
}
+
+void AsmPrinter::printSuffixedName(std::string &Name, const char* Suffix) {
+ printSuffixedName(Name.c_str(), Suffix);
+}