eliminate a bunch of \n's that are being printed to O. Next up is to kill

off "EOL".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-03-09 23:38:23 +00:00
parent fcdae492ea
commit 0d9d70f013
2 changed files with 19 additions and 35 deletions

View File

@ -131,17 +131,15 @@ void DIE::print(raw_ostream &O, unsigned IncIndent) {
<< "Die: " << "Die: "
<< format("0x%lx", (long)(intptr_t)this) << format("0x%lx", (long)(intptr_t)this)
<< ", Offset: " << Offset << ", Offset: " << Offset
<< ", Size: " << Size << ", Size: " << Size << "\n";
<< "\n";
O << Indent O << Indent
<< dwarf::TagString(Abbrev.getTag()) << dwarf::TagString(Abbrev.getTag())
<< " " << " "
<< dwarf::ChildrenString(Abbrev.getChildrenFlag()); << dwarf::ChildrenString(Abbrev.getChildrenFlag()) << "\n";
} else { } else {
O << "Size: " << Size; O << "Size: " << Size << "\n";
} }
O << "\n";
const SmallVector<DIEAbbrevData, 8> &Data = Abbrev.getData(); const SmallVector<DIEAbbrevData, 8> &Data = Abbrev.getData();
@ -286,7 +284,6 @@ void DIELabel::print(raw_ostream &O) {
void DIESectionOffset::EmitValue(DwarfPrinter *D, unsigned Form) const { void DIESectionOffset::EmitValue(DwarfPrinter *D, unsigned Form) const {
bool IsSmall = Form == dwarf::DW_FORM_data4; bool IsSmall = Form == dwarf::DW_FORM_data4;
D->EmitSectionOffset(Label, Section, IsSmall, IsEH); D->EmitSectionOffset(Label, Section, IsSmall, IsEH);
D->getAsm()->O << '\n'; // FIXME: Necesssary?
} }
/// SizeOf - Determine size of delta value in bytes. /// SizeOf - Determine size of delta value in bytes.
@ -372,10 +369,8 @@ void DIEBlock::EmitValue(DwarfPrinter *D, unsigned Form) const {
} }
const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData(); const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();
for (unsigned i = 0, N = Values.size(); i < N; ++i) { for (unsigned i = 0, N = Values.size(); i < N; ++i)
Asm->O << '\n';
Values[i]->EmitValue(D, AbbrevData[i].getForm()); Values[i]->EmitValue(D, AbbrevData[i].getForm());
}
} }
/// SizeOf - Determine size of block data in bytes. /// SizeOf - Determine size of block data in bytes.

View File

@ -2360,8 +2360,6 @@ void DwarfDebug::emitDIE(DIE *Die) {
unsigned AbbrevNumber = Die->getAbbrevNumber(); unsigned AbbrevNumber = Die->getAbbrevNumber();
const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1]; const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1];
Asm->O << '\n';
// Emit the code (index) for the abbreviation. // Emit the code (index) for the abbreviation.
if (Asm->VerboseAsm) if (Asm->VerboseAsm)
Asm->OutStreamer.AddComment("Abbrev [" + Twine(AbbrevNumber) + "] 0x" + Asm->OutStreamer.AddComment("Abbrev [" + Twine(AbbrevNumber) + "] 0x" +
@ -2396,7 +2394,6 @@ void DwarfDebug::emitDIE(DIE *Die) {
default: default:
// Emit an attribute using the defined form. // Emit an attribute using the defined form.
Values[i]->EmitValue(this, Form); Values[i]->EmitValue(this, Form);
O << "\n"; // REMOVE This once all EmitValue impls emit their own newline.
break; break;
} }
} }
@ -2444,7 +2441,6 @@ void DwarfDebug::emitDebugInfo() {
Asm->EmitInt8(0); EOL("Extra Pad For GDB"); Asm->EmitInt8(0); EOL("Extra Pad For GDB");
Asm->EmitInt8(0); EOL("Extra Pad For GDB"); Asm->EmitInt8(0); EOL("Extra Pad For GDB");
Asm->OutStreamer.EmitLabel(getDWLabel("info_end", ModuleCU->getID())); Asm->OutStreamer.EmitLabel(getDWLabel("info_end", ModuleCU->getID()));
Asm->O << '\n';
} }
/// emitAbbreviations - Emit the abbreviation section. /// emitAbbreviations - Emit the abbreviation section.
@ -2468,7 +2464,6 @@ void DwarfDebug::emitAbbreviations() const {
// Emit the abbreviations data. // Emit the abbreviations data.
Abbrev->Emit(this); Abbrev->Emit(this);
Asm->O << '\n';
} }
// Mark end of abbreviations. // Mark end of abbreviations.
@ -2579,7 +2574,6 @@ void DwarfDebug::emitDebugLines() {
O << '\t' << MAI->getCommentString() << " Section" O << '\t' << MAI->getCommentString() << " Section"
<< S->getName() << '\n'; << S->getName() << '\n';
}*/ }*/
Asm->O << '\n';
// Dwarf assumes we start with first line of first source file. // Dwarf assumes we start with first line of first source file.
unsigned Source = 1; unsigned Source = 1;
@ -2593,9 +2587,7 @@ void DwarfDebug::emitDebugLines() {
if (LineInfo.getLine() == 0) continue; if (LineInfo.getLine() == 0) continue;
if (!Asm->isVerbose()) if (Asm->isVerbose()) {
Asm->O << '\n';
else {
std::pair<unsigned, unsigned> SourceID = std::pair<unsigned, unsigned> SourceID =
getSourceDirectoryAndFileIds(LineInfo.getSourceID()); getSourceDirectoryAndFileIds(LineInfo.getSourceID());
O << '\t' << MAI->getCommentString() << ' ' O << '\t' << MAI->getCommentString() << ' '
@ -2817,14 +2809,14 @@ void DwarfDebug::emitDebugPubTypes() {
/// ///
void DwarfDebug::emitDebugStr() { void DwarfDebug::emitDebugStr() {
// Check to see if it is worth the effort. // Check to see if it is worth the effort.
if (!StringPool.empty()) { if (StringPool.empty()) return;
// Start the dwarf str section. // Start the dwarf str section.
Asm->OutStreamer.SwitchSection( Asm->OutStreamer.SwitchSection(
Asm->getObjFileLowering().getDwarfStrSection()); Asm->getObjFileLowering().getDwarfStrSection());
// For each of strings in the string pool. // For each of strings in the string pool.
for (unsigned StringID = 1, N = StringPool.size(); for (unsigned StringID = 1, N = StringPool.size(); StringID <= N; ++StringID){
StringID <= N; ++StringID) {
// Emit a label for reference from debug information entries. // Emit a label for reference from debug information entries.
Asm->OutStreamer.EmitLabel(getDWLabel("string", StringID)); Asm->OutStreamer.EmitLabel(getDWLabel("string", StringID));
@ -2832,9 +2824,6 @@ void DwarfDebug::emitDebugStr() {
const std::string &String = StringPool[StringID]; const std::string &String = StringPool[StringID];
Asm->OutStreamer.EmitBytes(StringRef(String.c_str(), String.size()+1), 0); Asm->OutStreamer.EmitBytes(StringRef(String.c_str(), String.size()+1), 0);
} }
Asm->O << '\n';
}
} }
/// emitDebugLoc - Emit visible names into a debug loc section. /// emitDebugLoc - Emit visible names into a debug loc section.