[llvm-commits] [llvm] r80704 - in /llvm/trunk/lib: CodeGen/AsmPrinter/DwarfException.cpp Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
Jim Grosbach
grosbach at apple.com
Tue Sep 1 11:49:12 PDT 2009
Author: grosbach
Date: Tue Sep 1 13:49:12 2009
New Revision: 80704
URL: http://llvm.org/viewvc/llvm-project?rev=80704&view=rev
Log:
Use raw_ostream instead of sstream
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=80704&r1=80703&r2=80704&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 1 13:49:12 2009
@@ -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 <sstream>
using namespace llvm;
static TimerGroup &getDwarfTimerGroup() {
@@ -601,12 +601,10 @@
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.
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=80704&r1=80703&r2=80704&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Sep 1 13:49:12 2009
@@ -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 <cctype>
-#include <sstream>
using namespace llvm;
STATISTIC(EmittedInsts, "Number of machine instrs printed");
@@ -162,10 +160,10 @@
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,
More information about the llvm-commits
mailing list