Fix visitTRUNCATE for legal i1 values
[oota-llvm.git] / lib / DebugInfo / DWARFContext.cpp
index daf7cdd98c63398eef39f5f2fea4c1a267938396..e17387b31d352211ed858572e7a6a2698b3fa9fb 100644 (file)
@@ -136,6 +136,16 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
     }
   }
 
+  if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) {
+    OS << "\n.debug_line.dwo contents:\n";
+    unsigned stmtOffset = 0;
+    DataExtractor lineData(getLineDWOSection().Data, isLittleEndian(),
+                           savedAddressByteSize);
+    DWARFDebugLine::DumpingState state(OS);
+    while (DWARFDebugLine::parsePrologue(lineData, &stmtOffset, &state.Prologue))
+      state.finalize();
+  }
+
   if (DumpType == DIDT_All || DumpType == DIDT_Str) {
     OS << "\n.debug_str contents:\n";
     DataExtractor strData(getStringSection(), isLittleEndian(), 0);
@@ -603,8 +613,8 @@ static bool consumeCompressedDebugSectionHeader(StringRef &data,
 DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
   IsLittleEndian(Obj->isLittleEndian()),
   AddressSize(Obj->getBytesInAddress()) {
-  for (object::section_iterator i = Obj->begin_sections(),
-                                e = Obj->end_sections();
+  for (object::section_iterator i = Obj->section_begin(),
+                                e = Obj->section_end();
        i != e; ++i) {
     StringRef name;
     i->getName(name);
@@ -645,6 +655,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
             .Case("debug_gnu_pubtypes", &GnuPubTypesSection)
             .Case("debug_info.dwo", &InfoDWOSection.Data)
             .Case("debug_abbrev.dwo", &AbbrevDWOSection)
+            .Case("debug_line.dwo", &LineDWOSection.Data)
             .Case("debug_str.dwo", &StringDWOSection)
             .Case("debug_str_offsets.dwo", &StringOffsetDWOSection)
             .Case("debug_addr", &AddrSection)
@@ -665,7 +676,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
     }
 
     section_iterator RelocatedSection = i->getRelocatedSection();
-    if (RelocatedSection == Obj->end_sections())
+    if (RelocatedSection == Obj->section_end())
       continue;
 
     StringRef RelSecName;
@@ -692,11 +703,11 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
         continue;
     }
 
-    if (i->begin_relocations() != i->end_relocations()) {
+    if (i->relocation_begin() != i->relocation_end()) {
       uint64_t SectionSize;
       RelocatedSection->getSize(SectionSize);
-      for (object::relocation_iterator reloc_i = i->begin_relocations(),
-                                       reloc_e = i->end_relocations();
+      for (object::relocation_iterator reloc_i = i->relocation_begin(),
+                                       reloc_e = i->relocation_end();
            reloc_i != reloc_e; ++reloc_i) {
         uint64_t Address;
         reloc_i->getOffset(Address);