remove the raw_ostream from various dwarf printing things.

The only thing left is LEB printing, which uses EmitRawText
for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-04-04 07:48:20 +00:00
parent 7d73c7f0d6
commit 75f50725c1
9 changed files with 25 additions and 35 deletions

View File

@@ -68,8 +68,7 @@ public:
/// BeginModule - Emit all Dwarf sections that should come prior to the /// BeginModule - Emit all Dwarf sections that should come prior to the
/// content. /// content.
void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS, void BeginModule(Module *M, AsmPrinter *A);
AsmPrinter *A, const MCAsmInfo *T);
/// EndModule - Emit all Dwarf sections that should come after the content. /// EndModule - Emit all Dwarf sections that should come after the content.
/// ///

View File

@@ -137,7 +137,7 @@ bool AsmPrinter::doInitialization(Module &M) {
DW = getAnalysisIfAvailable<DwarfWriter>(); DW = getAnalysisIfAvailable<DwarfWriter>();
if (DW) if (DW)
DW->BeginModule(&M, MMI, O, this, MAI); DW->BeginModule(&M, this);
return false; return false;
} }

View File

@@ -298,8 +298,8 @@ DbgScope::~DbgScope() {
} // end llvm namespace } // end llvm namespace
DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T) DwarfDebug::DwarfDebug(AsmPrinter *A)
: DwarfPrinter(OS, A, T), ModuleCU(0), : DwarfPrinter(A), ModuleCU(0),
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(), AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
DIEBlocks(), SectionSourceLines(), didInitial(false), shouldEmit(false), DIEBlocks(), SectionSourceLines(), didInitial(false), shouldEmit(false),
CurrentFnDbgScope(0), DebugTimer(0) { CurrentFnDbgScope(0), DebugTimer(0) {
@@ -1780,7 +1780,7 @@ void DwarfDebug::constructSubprogramDIE(MDNode *N) {
/// beginModule - Emit all Dwarf sections that should come prior to the /// beginModule - Emit all Dwarf sections that should come prior to the
/// content. Create global DIEs and emit initial debug info sections. /// content. Create global DIEs and emit initial debug info sections.
/// This is inovked by the target AsmPrinter. /// This is inovked by the target AsmPrinter.
void DwarfDebug::beginModule(Module *M, MachineModuleInfo *mmi) { void DwarfDebug::beginModule(Module *M) {
this->M = M; this->M = M;
if (!MAI->doesSupportDebugInformation()) if (!MAI->doesSupportDebugInformation())
@@ -1809,7 +1809,7 @@ void DwarfDebug::beginModule(Module *M, MachineModuleInfo *mmi) {
E = DbgFinder.global_variable_end(); I != E; ++I) E = DbgFinder.global_variable_end(); I != E; ++I)
constructGlobalVariableDIE(*I); constructGlobalVariableDIE(*I);
MMI = mmi; MMI = Asm->MMI;
shouldEmit = true; shouldEmit = true;
MMI->setDebugInfoAvailability(true); MMI->setDebugInfoAvailability(true);

View File

@@ -487,8 +487,8 @@ class DwarfDebug : public DwarfPrinter {
/// GetOrCreateSourceID - Look up the source id with the given directory and /// GetOrCreateSourceID - Look up the source id with the given directory and
/// source file names. If none currently exists, create a new id and insert it /// source file names. If none currently exists, create a new id and insert it
/// in the SourceIds map. This can update DirectoryNames and SourceFileNames maps /// in the SourceIds map. This can update DirectoryNames and SourceFileNames
/// as well. /// maps as well.
unsigned GetOrCreateSourceID(StringRef DirName, StringRef FileName); unsigned GetOrCreateSourceID(StringRef DirName, StringRef FileName);
void constructCompileUnit(MDNode *N); void constructCompileUnit(MDNode *N);
@@ -507,7 +507,7 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.
// //
DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T); DwarfDebug(AsmPrinter *A);
virtual ~DwarfDebug(); virtual ~DwarfDebug();
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
@@ -516,7 +516,7 @@ public:
/// beginModule - Emit all Dwarf sections that should come prior to the /// beginModule - Emit all Dwarf sections that should come prior to the
/// content. /// content.
void beginModule(Module *M, MachineModuleInfo *MMI); void beginModule(Module *M);
/// endModule - Emit all Dwarf sections that should come after the content. /// endModule - Emit all Dwarf sections that should come after the content.
/// ///

View File

@@ -37,9 +37,8 @@
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"
using namespace llvm; using namespace llvm;
DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A, DwarfException::DwarfException(AsmPrinter *A)
const MCAsmInfo *T) : DwarfPrinter(A), shouldEmitTable(false), shouldEmitMoves(false),
: DwarfPrinter(OS, A, T), shouldEmitTable(false),shouldEmitMoves(false),
shouldEmitTableModule(false), shouldEmitMovesModule(false), shouldEmitTableModule(false), shouldEmitMovesModule(false),
ExceptionTimer(0) { ExceptionTimer(0) {
if (TimePassesIsEnabled) if (TimePassesIsEnabled)

View File

@@ -166,14 +166,14 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.
// //
DwarfException(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T); DwarfException(AsmPrinter *A);
virtual ~DwarfException(); virtual ~DwarfException();
/// BeginModule - Emit all exception information that should come prior to the /// BeginModule - Emit all exception information that should come prior to the
/// content. /// content.
void BeginModule(Module *m, MachineModuleInfo *mmi) { void BeginModule(Module *m) {
this->M = m; this->M = m;
this->MMI = mmi; this->MMI = Asm->MMI;
} }
/// EndModule - Emit all exception information that should come after the /// EndModule - Emit all exception information that should come after the

View File

@@ -31,8 +31,8 @@
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
using namespace llvm; using namespace llvm;
DwarfPrinter::DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T) DwarfPrinter::DwarfPrinter(AsmPrinter *A)
: O(OS), Asm(A), MAI(T), TD(Asm->TM.getTargetData()), : Asm(A), MAI(A->MAI), TD(Asm->TM.getTargetData()),
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL), RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
SubprogramCount(0) {} SubprogramCount(0) {}
@@ -139,8 +139,7 @@ void DwarfPrinter::EmitSLEB128(int Value, const char *Desc) const {
if (MAI->hasLEB128()) { if (MAI->hasLEB128()) {
// FIXME: MCize. // FIXME: MCize.
O << "\t.sleb128\t" << Value; Asm->OutStreamer.EmitRawText("\t.sleb128\t" + Twine(Value));
Asm->OutStreamer.AddBlankLine();
return; return;
} }
@@ -165,8 +164,7 @@ void DwarfPrinter::EmitULEB128(unsigned Value, const char *Desc,
if (MAI->hasLEB128() && PadTo == 0) { if (MAI->hasLEB128() && PadTo == 0) {
// FIXME: MCize. // FIXME: MCize.
O << "\t.uleb128\t" << Value; Asm->OutStreamer.EmitRawText("\t.uleb128\t" + Twine(Value));
Asm->OutStreamer.AddBlankLine();
return; return;
} }

View File

@@ -39,9 +39,6 @@ protected:
// Core attributes used by the DWARF printer. // Core attributes used by the DWARF printer.
// //
/// O - Stream to .s file.
raw_ostream &O;
/// Asm - Target of Dwarf emission. /// Asm - Target of Dwarf emission.
AsmPrinter *Asm; AsmPrinter *Asm;
@@ -66,7 +63,7 @@ protected:
/// SubprogramCount - The running count of functions being compiled. /// SubprogramCount - The running count of functions being compiled.
unsigned SubprogramCount; unsigned SubprogramCount;
DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T); DwarfPrinter(AsmPrinter *A);
public: public:
//===------------------------------------------------------------------===// //===------------------------------------------------------------------===//

View File

@@ -36,14 +36,11 @@ DwarfWriter::~DwarfWriter() {
/// BeginModule - Emit all Dwarf sections that should come prior to the /// BeginModule - Emit all Dwarf sections that should come prior to the
/// content. /// content.
void DwarfWriter::BeginModule(Module *M, void DwarfWriter::BeginModule(Module *M, AsmPrinter *A) {
MachineModuleInfo *MMI, DE = new DwarfException(A);
raw_ostream &OS, AsmPrinter *A, DD = new DwarfDebug(A);
const MCAsmInfo *T) { DE->BeginModule(M);
DE = new DwarfException(OS, A, T); DD->beginModule(M);
DD = new DwarfDebug(OS, A, T);
DE->BeginModule(M, MMI);
DD->beginModule(M, MMI);
} }
/// EndModule - Emit all Dwarf sections that should come after the content. /// EndModule - Emit all Dwarf sections that should come after the content.