[llvm-commits] [llvm] r98102 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DIE.cpp DwarfDebug.cpp
Chris Lattner
sabre at nondot.org
Tue Mar 9 15:38:24 PST 2010
Author: lattner
Date: Tue Mar 9 17:38:23 2010
New Revision: 98102
URL: http://llvm.org/viewvc/llvm-project?rev=98102&view=rev
Log:
eliminate a bunch of \n's that are being printed to O. Next up is to kill
off "EOL".
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=98102&r1=98101&r2=98102&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Tue Mar 9 17:38:23 2010
@@ -131,17 +131,15 @@
<< "Die: "
<< format("0x%lx", (long)(intptr_t)this)
<< ", Offset: " << Offset
- << ", Size: " << Size
- << "\n";
+ << ", Size: " << Size << "\n";
O << Indent
<< dwarf::TagString(Abbrev.getTag())
<< " "
- << dwarf::ChildrenString(Abbrev.getChildrenFlag());
+ << dwarf::ChildrenString(Abbrev.getChildrenFlag()) << "\n";
} else {
- O << "Size: " << Size;
+ O << "Size: " << Size << "\n";
}
- O << "\n";
const SmallVector<DIEAbbrevData, 8> &Data = Abbrev.getData();
@@ -286,7 +284,6 @@
void DIESectionOffset::EmitValue(DwarfPrinter *D, unsigned Form) const {
bool IsSmall = Form == dwarf::DW_FORM_data4;
D->EmitSectionOffset(Label, Section, IsSmall, IsEH);
- D->getAsm()->O << '\n'; // FIXME: Necesssary?
}
/// SizeOf - Determine size of delta value in bytes.
@@ -367,15 +364,13 @@
case dwarf::DW_FORM_block1: Asm->EmitInt8(Size); break;
case dwarf::DW_FORM_block2: Asm->EmitInt16(Size); break;
case dwarf::DW_FORM_block4: Asm->EmitInt32(Size); break;
- case dwarf::DW_FORM_block: D->EmitULEB128(Size); break;
- default: llvm_unreachable("Improper form for block"); break;
+ case dwarf::DW_FORM_block: D->EmitULEB128(Size); break;
+ default: llvm_unreachable("Improper form for block"); break;
}
const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();
- for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- Asm->O << '\n';
+ for (unsigned i = 0, N = Values.size(); i < N; ++i)
Values[i]->EmitValue(D, AbbrevData[i].getForm());
- }
}
/// SizeOf - Determine size of block data in bytes.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=98102&r1=98101&r2=98102&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Mar 9 17:38:23 2010
@@ -2360,8 +2360,6 @@
unsigned AbbrevNumber = Die->getAbbrevNumber();
const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1];
- Asm->O << '\n';
-
// Emit the code (index) for the abbreviation.
if (Asm->VerboseAsm)
Asm->OutStreamer.AddComment("Abbrev [" + Twine(AbbrevNumber) + "] 0x" +
@@ -2396,7 +2394,6 @@
default:
// Emit an attribute using the defined form.
Values[i]->EmitValue(this, Form);
- O << "\n"; // REMOVE This once all EmitValue impls emit their own newline.
break;
}
}
@@ -2444,7 +2441,6 @@
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->O << '\n';
}
/// emitAbbreviations - Emit the abbreviation section.
@@ -2468,7 +2464,6 @@
// Emit the abbreviations data.
Abbrev->Emit(this);
- Asm->O << '\n';
}
// Mark end of abbreviations.
@@ -2579,7 +2574,6 @@
O << '\t' << MAI->getCommentString() << " Section"
<< S->getName() << '\n';
}*/
- Asm->O << '\n';
// Dwarf assumes we start with first line of first source file.
unsigned Source = 1;
@@ -2593,9 +2587,7 @@
if (LineInfo.getLine() == 0) continue;
- if (!Asm->isVerbose())
- Asm->O << '\n';
- else {
+ if (Asm->isVerbose()) {
std::pair<unsigned, unsigned> SourceID =
getSourceDirectoryAndFileIds(LineInfo.getSourceID());
O << '\t' << MAI->getCommentString() << ' '
@@ -2817,23 +2809,20 @@
///
void DwarfDebug::emitDebugStr() {
// Check to see if it is worth the effort.
- if (!StringPool.empty()) {
- // Start the dwarf str section.
- Asm->OutStreamer.SwitchSection(
+ if (StringPool.empty()) return;
+
+ // Start the dwarf str section.
+ Asm->OutStreamer.SwitchSection(
Asm->getObjFileLowering().getDwarfStrSection());
- // For each of strings in the string pool.
- for (unsigned StringID = 1, N = StringPool.size();
- StringID <= N; ++StringID) {
- // Emit a label for reference from debug information entries.
- Asm->OutStreamer.EmitLabel(getDWLabel("string", StringID));
-
- // Emit the string itself.
- const std::string &String = StringPool[StringID];
- Asm->OutStreamer.EmitBytes(StringRef(String.c_str(), String.size()+1), 0);
- }
-
- Asm->O << '\n';
+ // For each of strings in the string pool.
+ for (unsigned StringID = 1, N = StringPool.size(); StringID <= N; ++StringID){
+ // Emit a label for reference from debug information entries.
+ Asm->OutStreamer.EmitLabel(getDWLabel("string", StringID));
+
+ // Emit the string itself.
+ const std::string &String = StringPool[StringID];
+ Asm->OutStreamer.EmitBytes(StringRef(String.c_str(), String.size()+1), 0);
}
}
More information about the llvm-commits
mailing list