Use raw_ostream instead of sstream

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2009-09-01 18:49:12 +00:00
parent 81dfb38852
commit c40d9f9bae
2 changed files with 10 additions and 14 deletions

View File

@ -28,8 +28,8 @@
#include "llvm/Support/Mangler.h" #include "llvm/Support/Mangler.h"
#include "llvm/Support/Timer.h" #include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include <sstream>
using namespace llvm; using namespace llvm;
static TimerGroup &getDwarfTimerGroup() { static TimerGroup &getDwarfTimerGroup() {
@ -601,12 +601,10 @@ void DwarfException::EmitExceptionTable() {
EmitLabel("exception", SubprogramCount); EmitLabel("exception", SubprogramCount);
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) { if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
std::stringstream out; SmallString<256> LSDAName;
out << Asm->getFunctionNumber(); raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() <<
std::string LSDAName = "_LSDA_" << Asm->getFunctionNumber();
Asm->Mang->makeNameProper(std::string("LSDA_") + out.str(), O << LSDAName.str() << ":\n";
Mangler::Private);
O << LSDAName << ":\n";
} }
// Emit the header. // Emit the header.

View File

@ -1,5 +1,3 @@
//===-- ARMAsmPrinter.cpp - ARM LLVM assembly writer ----------------------===//
//
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
// This file is distributed under the University of Illinois Open Source // This file is distributed under the University of Illinois Open Source
@ -36,6 +34,7 @@
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSet.h" #include "llvm/ADT/StringSet.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
@ -44,7 +43,6 @@
#include "llvm/Support/MathExtras.h" #include "llvm/Support/MathExtras.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
#include <cctype> #include <cctype>
#include <sstream>
using namespace llvm; using namespace llvm;
STATISTIC(EmittedInsts, "Number of machine instrs printed"); STATISTIC(EmittedInsts, "Number of machine instrs printed");
@ -162,10 +160,10 @@ namespace {
std::string Name; std::string Name;
if (ACPV->isLSDA()) { if (ACPV->isLSDA()) {
std::stringstream out; SmallString<256> LSDAName;
out << getFunctionNumber(); raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() <<
Name = Mang->makeNameProper(std::string("LSDA_") + out.str(), "_LSDA_" << getFunctionNumber();
Mangler::Private); Name = LSDAName.str();
} else if (GV) { } else if (GV) {
bool isIndirect = Subtarget->isTargetDarwin() && bool isIndirect = Subtarget->isTargetDarwin() &&
Subtarget->GVIsIndirectSymbol(GV, Subtarget->GVIsIndirectSymbol(GV,