1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

switch from std::string to SmallString + raw_svector_ostream.

llvm-svn: 80807
This commit is contained in:
Chris Lattner 2009-09-02 17:37:38 +00:00
parent 1342ef5d8b
commit 825c74b1d9

View File

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