diff options
author | Reid Kleckner <rnk@google.com> | 2015-12-16 18:19:34 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-12-16 18:19:34 +0000 |
commit | b88796baf7ce518b5b0d211236bc4a973e65f600 (patch) | |
tree | c3dc6d8db7bd1f8fc2d96e0f475885b035d3a3ca | |
parent | d37fe9acb5d6349ff3d47bc49cf4224b974c6908 (diff) | |
download | bcm5719-llvm-b88796baf7ce518b5b0d211236bc4a973e65f600.tar.gz bcm5719-llvm-b88796baf7ce518b5b0d211236bc4a973e65f600.zip |
Revert "[llvm-readobj] Simplify usage of -codeview flag"
This reverts commit r255790.
llvm-svn: 255791
-rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 20 | ||||
-rw-r--r-- | llvm/tools/llvm-readobj/ObjDumper.h | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-readobj/llvm-readobj.cpp | 2 |
3 files changed, 7 insertions, 16 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index 516d1cf8057..5b4129a10c5 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -60,7 +60,6 @@ public: void printCOFFExports() override; void printCOFFDirectives() override; void printCOFFBaseReloc() override; - void printCodeViewDebugInfo() override; void printStackMap() const override; private: void printSymbol(const SymbolRef &Sym); @@ -72,7 +71,7 @@ private: void printBaseOfDataField(const pe32_header *Hdr); void printBaseOfDataField(const pe32plus_header *Hdr); - void printCodeViewSection(const SectionRef &Section); + void printCodeViewDebugInfo(const SectionRef &Section); void printCodeViewSymbolsSubsection(StringRef Subsection, const SectionRef &Section, @@ -475,16 +474,7 @@ void COFFDumper::printBaseOfDataField(const pe32_header *Hdr) { void COFFDumper::printBaseOfDataField(const pe32plus_header *) {} -void COFFDumper::printCodeViewDebugInfo() { - for (const SectionRef &S : Obj->sections()) { - StringRef SecName; - error(S.getName(SecName)); - if (SecName == ".debug$S") - printCodeViewSection(S); - } -} - -void COFFDumper::printCodeViewSection(const SectionRef &Section) { +void COFFDumper::printCodeViewDebugInfo(const SectionRef &Section) { StringRef Data; error(Section.getContents(Data)); @@ -526,7 +516,8 @@ void COFFDumper::printCodeViewSection(const SectionRef &Section) { switch (SubSectionType) { case COFF::DEBUG_SYMBOL_SUBSECTION: - printCodeViewSymbolsSubsection(Contents, Section, Offset); + if (opts::SectionSymbols) + printCodeViewSymbolsSubsection(Contents, Section, Offset); break; case COFF::DEBUG_LINE_TABLE_SUBSECTION: { // Holds a PC to file:line table. Some data to parse this subsection is @@ -786,6 +777,9 @@ void COFFDumper::printSections() { } } + if (Name == ".debug$S" && opts::CodeView) + printCodeViewDebugInfo(Sec); + if (opts::SectionData && !(Section->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) { StringRef Data; diff --git a/llvm/tools/llvm-readobj/ObjDumper.h b/llvm/tools/llvm-readobj/ObjDumper.h index db26d698355..2ca1300439e 100644 --- a/llvm/tools/llvm-readobj/ObjDumper.h +++ b/llvm/tools/llvm-readobj/ObjDumper.h @@ -56,7 +56,6 @@ public: virtual void printCOFFExports() { } virtual void printCOFFDirectives() { } virtual void printCOFFBaseReloc() { } - virtual void printCodeViewDebugInfo() { } // Only implemented for MachO. virtual void printMachODataInCode() { } diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index 92ee299efce..2a75ababb2e 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -354,8 +354,6 @@ static void dumpObject(const ObjectFile *Obj) { Dumper->printCOFFDirectives(); if (opts::COFFBaseRelocs) Dumper->printCOFFBaseReloc(); - if (opts::CodeView) - Dumper->printCodeViewDebugInfo(); } if (Obj->isMachO()) { if (opts::MachODataInCode) |