[llvm-commits] [llvm] r80807 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Chris Lattner
sabre at nondot.org
Wed Sep 2 10:37:38 PDT 2009
Author: lattner
Date: Wed Sep 2 12:37:38 2009
New Revision: 80807
URL: http://llvm.org/viewvc/llvm-project?rev=80807&view=rev
Log:
switch from std::string to SmallString + raw_svector_ostream.
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=80807&r1=80806&r2=80807&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed Sep 2 12:37:38 2009
@@ -22,22 +22,20 @@
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h"
#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringExtras.h" // fixme, kill utostr.
-
using namespace llvm;
MCSymbol *X86ATTAsmPrinter::GetPICBaseSymbol() {
// FIXME: the actual label generated doesn't matter here! Just mangle in
// something unique (the function number) with Private prefix.
- std::string Name;
+ SmallString<60> Name;
if (Subtarget->isTargetDarwin()) {
- Name = "L" + utostr(getFunctionNumber())+"$pb";
+ raw_svector_ostream(Name) << 'L' << getFunctionNumber() << "$pb";
} else {
assert(Subtarget->isTargetELF() && "Don't know how to print PIC label!");
- Name = ".Lllvm$" + utostr(getFunctionNumber())+".$piclabel";
- }
- return OutContext.GetOrCreateSymbol(Name);
+ raw_svector_ostream(Name) << ".Lllvm$" << getFunctionNumber()<<".$piclabel";
+ }
+ return OutContext.GetOrCreateSymbol(StringRef(Name.data(), Name.size()));
}
More information about the llvm-commits
mailing list