[llvm-commits] [llvm] r84565 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 19 16:05:23 PDT 2009
Author: lattner
Date: Mon Oct 19 18:05:23 2009
New Revision: 84565
URL: http://llvm.org/viewvc/llvm-project?rev=84565&view=rev
Log:
simplify by using the twine form of GetOrCreateSymbol
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=84565&r1=84564&r2=84565&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Mon Oct 19 18:05:23 2009
@@ -38,10 +38,8 @@
MCSymbol *X86MCInstLower::GetPICBaseSymbol() const {
- SmallString<60> Name;
- raw_svector_ostream(Name) << AsmPrinter.MAI->getPrivateGlobalPrefix()
- << AsmPrinter.getFunctionNumber() << "$pb";
- return Ctx.GetOrCreateSymbol(Name.str());
+ return Ctx.GetOrCreateSymbol(Twine(AsmPrinter.MAI->getPrivateGlobalPrefix())+
+ Twine(AsmPrinter.getFunctionNumber())+"$pb");
}
@@ -449,10 +447,9 @@
// MYGLOBAL + (. - PICBASE)
// However, we can't generate a ".", so just emit a new label here and refer
// to it. We know that this operand flag occurs at most once per function.
- SmallString<64> Name;
- raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix()
- << "picbaseref" << getFunctionNumber();
- MCSymbol *DotSym = OutContext.GetOrCreateSymbol(Name.str());
+ const char *Prefix = MAI->getPrivateGlobalPrefix();
+ MCSymbol *DotSym = OutContext.GetOrCreateSymbol(Twine(Prefix)+"picbaseref"+
+ Twine(getFunctionNumber()));
OutStreamer.EmitLabel(DotSym);
// Now that we have emitted the label, lower the complex operand expression.
More information about the llvm-commits
mailing list