Avoid unnecessary string construction during asm printing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53215 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-07-08 00:55:58 +00:00
parent 82eec45b00
commit 77c8f7674d
4 changed files with 36 additions and 15 deletions

View File

@@ -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);
}