From: Jim Grosbach Date: Tue, 1 Sep 2009 18:49:12 +0000 (+0000) Subject: Use raw_ostream instead of sstream X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c40d9f9bae70c83947bf8fa5f9ee97adbf1bb0c0;p=oota-llvm.git Use raw_ostream instead of sstream git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80704 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 6d6af83bd27..8e0485e8cf0 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -28,8 +28,8 @@ #include "llvm/Support/Mangler.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" -#include using namespace llvm; static TimerGroup &getDwarfTimerGroup() { @@ -601,12 +601,10 @@ void DwarfException::EmitExceptionTable() { EmitLabel("exception", SubprogramCount); if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) { - std::stringstream out; - out << Asm->getFunctionNumber(); - std::string LSDAName = - Asm->Mang->makeNameProper(std::string("LSDA_") + out.str(), - Mangler::Private); - O << LSDAName << ":\n"; + SmallString<256> LSDAName; + raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() << + "_LSDA_" << Asm->getFunctionNumber(); + O << LSDAName.str() << ":\n"; } // Emit the header. diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 49e2490cf3c..244188a4b35 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -1,5 +1,3 @@ -//===-- ARMAsmPrinter.cpp - ARM LLVM assembly writer ----------------------===// -// // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source @@ -36,6 +34,7 @@ #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetRegistry.h" #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Compiler.h" @@ -44,7 +43,6 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/FormattedStream.h" #include -#include using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); @@ -162,10 +160,10 @@ namespace { std::string Name; if (ACPV->isLSDA()) { - std::stringstream out; - out << getFunctionNumber(); - Name = Mang->makeNameProper(std::string("LSDA_") + out.str(), - Mangler::Private); + SmallString<256> LSDAName; + raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() << + "_LSDA_" << getFunctionNumber(); + Name = LSDAName.str(); } else if (GV) { bool isIndirect = Subtarget->isTargetDarwin() && Subtarget->GVIsIndirectSymbol(GV,