diff options
| -rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.cpp | 17 | ||||
| -rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 37 | 
2 files changed, 19 insertions, 35 deletions
| diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index d894ba7..b9bb4af 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -131,17 +131,15 @@ void DIE::print(raw_ostream &O, unsigned IncIndent) {        << "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 DIELabel::print(raw_ostream &O) {  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 @@ void DIEBlock::EmitValue(DwarfPrinter *D, unsigned Form) const {    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. diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a84ef47..59ba223 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2360,8 +2360,6 @@ void DwarfDebug::emitDIE(DIE *Die) {    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 @@ void DwarfDebug::emitDIE(DIE *Die) {      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 @@ void DwarfDebug::emitDebugInfo() {    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 @@ void DwarfDebug::emitAbbreviations() const {        // Emit the abbreviations data.        Abbrev->Emit(this); -      Asm->O << '\n';      }      // Mark end of abbreviations. @@ -2579,7 +2574,6 @@ void DwarfDebug::emitDebugLines() {        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 @@ void DwarfDebug::emitDebugLines() {        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::emitDebugPubTypes() {  ///  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);    }  } | 
