summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-30 17:37:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-30 17:37:31 +0000
commitee2f195dd3e40f49698ca4dc2666ec09c770e80d (patch)
tree66fa9a69e5789356dfe844991e64bac9222f3a35 /tools
parentab44ce3d598882e51a25eb82eb7ae6308de85ae6 (diff)
Notes
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp14
-rw-r--r--tools/llvm-pdbdump/C13DebugFragmentVisitor.h22
-rw-r--r--tools/llvm-pdbdump/LLVMOutputStyle.cpp14
-rw-r--r--tools/llvm-pdbdump/YAMLOutputStyle.cpp16
-rw-r--r--tools/llvm-pdbdump/llvm-pdbdump.cpp13
-rw-r--r--tools/llvm-readobj/COFFDumper.cpp113
-rw-r--r--tools/llvm-readobj/CodeView.h54
7 files changed, 95 insertions, 151 deletions
diff --git a/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp b/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp
index b38b36532a719..78971eb5879a7 100644
--- a/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp
+++ b/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp
@@ -9,9 +9,9 @@
#include "C13DebugFragmentVisitor.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
#include "llvm/DebugInfo/PDB/Native/PDBStringTable.h"
#include "llvm/DebugInfo/PDB/Native/RawError.h"
@@ -25,25 +25,25 @@ C13DebugFragmentVisitor::C13DebugFragmentVisitor(PDBFile &F) : F(F) {}
C13DebugFragmentVisitor::~C13DebugFragmentVisitor() {}
Error C13DebugFragmentVisitor::visitUnknown(
- codeview::ModuleDebugUnknownFragmentRef &Fragment) {
+ codeview::DebugUnknownSubsectionRef &Fragment) {
return Error::success();
}
Error C13DebugFragmentVisitor::visitFileChecksums(
- codeview::ModuleDebugFileChecksumFragmentRef &Checksums) {
+ codeview::DebugChecksumsSubsectionRef &Checksums) {
assert(!this->Checksums.hasValue());
this->Checksums = Checksums;
return Error::success();
}
Error C13DebugFragmentVisitor::visitLines(
- codeview::ModuleDebugLineFragmentRef &Lines) {
+ codeview::DebugLinesSubsectionRef &Lines) {
this->Lines.push_back(Lines);
return Error::success();
}
Error C13DebugFragmentVisitor::visitInlineeLines(
- codeview::ModuleDebugInlineeLineFragmentRef &Lines) {
+ codeview::DebugInlineeLinesSubsectionRef &Lines) {
this->InlineeLines.push_back(Lines);
return Error::success();
}
diff --git a/tools/llvm-pdbdump/C13DebugFragmentVisitor.h b/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
index 1054b0c9f6e0a..a12f282c4c5ca 100644
--- a/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
+++ b/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
@@ -11,8 +11,8 @@
#define LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H
#include "llvm/ADT/Optional.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h"
#include "llvm/Support/Error.h"
#include <vector>
@@ -23,20 +23,20 @@ namespace pdb {
class PDBFile;
-class C13DebugFragmentVisitor : public codeview::ModuleDebugFragmentVisitor {
+class C13DebugFragmentVisitor : public codeview::DebugSubsectionVisitor {
public:
C13DebugFragmentVisitor(PDBFile &F);
~C13DebugFragmentVisitor();
- Error visitUnknown(codeview::ModuleDebugUnknownFragmentRef &Fragment) final;
+ Error visitUnknown(codeview::DebugUnknownSubsectionRef &Fragment) final;
- Error visitFileChecksums(
- codeview::ModuleDebugFileChecksumFragmentRef &Checksums) final;
+ Error
+ visitFileChecksums(codeview::DebugChecksumsSubsectionRef &Checksums) final;
- Error visitLines(codeview::ModuleDebugLineFragmentRef &Lines) final;
+ Error visitLines(codeview::DebugLinesSubsectionRef &Lines) final;
Error
- visitInlineeLines(codeview::ModuleDebugInlineeLineFragmentRef &Lines) final;
+ visitInlineeLines(codeview::DebugInlineeLinesSubsectionRef &Lines) final;
Error finished() final;
@@ -48,9 +48,9 @@ protected:
Expected<StringRef> getNameFromStringTable(uint32_t Offset);
Expected<StringRef> getNameFromChecksumsBuffer(uint32_t Offset);
- Optional<codeview::ModuleDebugFileChecksumFragmentRef> Checksums;
- std::vector<codeview::ModuleDebugInlineeLineFragmentRef> InlineeLines;
- std::vector<codeview::ModuleDebugLineFragmentRef> Lines;
+ Optional<codeview::DebugChecksumsSubsectionRef> Checksums;
+ std::vector<codeview::DebugInlineeLinesSubsectionRef> InlineeLines;
+ std::vector<codeview::DebugLinesSubsectionRef> Lines;
PDBFile &F;
};
diff --git a/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/tools/llvm-pdbdump/LLVMOutputStyle.cpp
index 07d3b226d7c6a..d95eca1aeddb1 100644
--- a/tools/llvm-pdbdump/LLVMOutputStyle.cpp
+++ b/tools/llvm-pdbdump/LLVMOutputStyle.cpp
@@ -15,14 +15,14 @@
#include "llvm-pdbdump.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h"
+#include "llvm/DebugInfo/CodeView/DebugUnknownSubsection.h"
#include "llvm/DebugInfo/CodeView/EnumTables.h"
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
#include "llvm/DebugInfo/CodeView/Line.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h"
#include "llvm/DebugInfo/CodeView/SymbolDumper.h"
#include "llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h"
#include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h"
@@ -830,8 +830,8 @@ Error LLVMOutputStyle::dumpDbiStream() {
return ExpectedTypes.takeError();
auto &IpiItems = *ExpectedTypes;
C13RawVisitor V(P, File, IpiItems);
- if (auto EC = codeview::visitModuleDebugFragments(
- ModS.linesAndChecksums(), V))
+ if (auto EC =
+ codeview::visitDebugSubsections(ModS.linesAndChecksums(), V))
return EC;
}
}
diff --git a/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/tools/llvm-pdbdump/YAMLOutputStyle.cpp
index 652182e8e9b3d..7aa68dee7d474 100644
--- a/tools/llvm-pdbdump/YAMLOutputStyle.cpp
+++ b/tools/llvm-pdbdump/YAMLOutputStyle.cpp
@@ -13,13 +13,13 @@
#include "PdbYaml.h"
#include "llvm-pdbdump.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h"
+#include "llvm/DebugInfo/CodeView/DebugUnknownSubsection.h"
#include "llvm/DebugInfo/CodeView/Line.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h"
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
#include "llvm/DebugInfo/PDB/Native/InfoStream.h"
@@ -207,8 +207,8 @@ YAMLOutputStyle::getFileLineInfo(const pdb::ModuleDebugStreamRef &ModS) {
yaml::PdbSourceFileInfo Info;
C13YamlVisitor Visitor(Info, File);
- if (auto EC = codeview::visitModuleDebugFragments(ModS.linesAndChecksums(),
- Visitor))
+ if (auto EC =
+ codeview::visitDebugSubsections(ModS.linesAndChecksums(), Visitor))
return std::move(EC);
return Info;
diff --git a/tools/llvm-pdbdump/llvm-pdbdump.cpp b/tools/llvm-pdbdump/llvm-pdbdump.cpp
index ff14c39cbaab3..baba862ae663f 100644
--- a/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -31,10 +31,10 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
#include "llvm/DebugInfo/CodeView/TypeStreamMerger.h"
#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h"
#include "llvm/DebugInfo/MSF/MSFBuilder.h"
@@ -543,8 +543,7 @@ static void yamlToPdb(StringRef Path) {
// File Checksums must be emitted before line information, because line
// info records use offsets into the checksum buffer to reference a file's
// source file name.
- auto Checksums =
- llvm::make_unique<ModuleDebugFileChecksumFragment>(Strings);
+ auto Checksums = llvm::make_unique<DebugChecksumsSubsection>(Strings);
auto &ChecksumRef = *Checksums;
if (!FLI.FileChecksums.empty()) {
for (auto &FC : FLI.FileChecksums)
@@ -554,7 +553,7 @@ static void yamlToPdb(StringRef Path) {
for (const auto &Fragment : FLI.LineFragments) {
auto Lines =
- llvm::make_unique<ModuleDebugLineFragment>(ChecksumRef, Strings);
+ llvm::make_unique<DebugLinesSubsection>(ChecksumRef, Strings);
Lines->setCodeSize(Fragment.CodeSize);
Lines->setRelocationAddress(Fragment.RelocSegment,
Fragment.RelocOffset);
@@ -582,7 +581,7 @@ static void yamlToPdb(StringRef Path) {
}
for (const auto &Inlinee : FLI.Inlinees) {
- auto Inlinees = llvm::make_unique<ModuleDebugInlineeLineFragment>(
+ auto Inlinees = llvm::make_unique<DebugInlineeLinesSubsection>(
ChecksumRef, Inlinee.HasExtraFiles);
for (const auto &Site : Inlinee.Sites) {
Inlinees->addInlineSite(Site.Inlinee, Site.FileName,
diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp
index a59caa351e725..663f7b4c8a820 100644
--- a/tools/llvm-readobj/COFFDumper.cpp
+++ b/tools/llvm-readobj/COFFDumper.cpp
@@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
#include "ARMWinEHPrinter.h"
-#include "CodeView.h"
#include "Error.h"
#include "ObjDumper.h"
#include "StackMapPrinter.h"
@@ -24,13 +23,14 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
+#include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
#include "llvm/DebugInfo/CodeView/Line.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
-#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
-#include "llvm/DebugInfo/CodeView/StringTable.h"
#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
#include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
#include "llvm/DebugInfo/CodeView/SymbolDumper.h"
@@ -157,9 +157,9 @@ private:
bool RelocCached = false;
RelocMapTy RelocMap;
- VarStreamArray<FileChecksumEntry> CVFileChecksumTable;
+ DebugChecksumsSubsectionRef CVFileChecksumTable;
- StringTableRef CVStringTable;
+ DebugStringTableSubsectionRef CVStringTable;
ScopedPrinter &Writer;
BinaryByteStream TypeContents;
@@ -200,7 +200,9 @@ public:
return CD.getFileNameForFileOffset(FileOffset);
}
- StringTableRef getStringTable() override { return CD.CVStringTable; }
+ DebugStringTableSubsectionRef getStringTable() override {
+ return CD.CVStringTable;
+ }
private:
COFFDumper &CD;
@@ -515,19 +517,19 @@ WeakExternalCharacteristics[] = {
};
static const EnumEntry<uint32_t> SubSectionTypes[] = {
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, Symbols),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, Lines),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, StringTable),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, FileChecksums),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, FrameData),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, InlineeLines),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, CrossScopeImports),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, CrossScopeExports),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, ILLines),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, FuncMDTokenMap),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, TypeMDTokenMap),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, MergedAssemblyInput),
- LLVM_READOBJ_ENUM_CLASS_ENT(ModuleDebugFragmentKind, CoffSymbolRVA),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, Symbols),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, Lines),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, StringTable),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FileChecksums),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FrameData),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, InlineeLines),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeImports),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeExports),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, ILLines),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FuncMDTokenMap),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, TypeMDTokenMap),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, MergedAssemblyInput),
+ LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CoffSymbolRVA),
};
static const EnumEntry<uint32_t> FrameDataFlags[] = {
@@ -774,16 +776,14 @@ void COFFDumper::initializeFileAndStringTables(BinaryStreamReader &Reader) {
StringRef Contents;
error(Reader.readFixedString(Contents, SubSectionSize));
- switch (ModuleDebugFragmentKind(SubType)) {
- case ModuleDebugFragmentKind::FileChecksums: {
- BinaryStreamReader CSR(Contents, support::little);
- error(CSR.readArray(CVFileChecksumTable, CSR.getLength()));
+ BinaryStreamRef ST(Contents, support::little);
+ switch (DebugSubsectionKind(SubType)) {
+ case DebugSubsectionKind::FileChecksums:
+ error(CVFileChecksumTable.initialize(ST));
break;
- }
- case ModuleDebugFragmentKind::StringTable: {
- BinaryStreamRef ST(Contents, support::little);
+ case DebugSubsectionKind::StringTable:
error(CVStringTable.initialize(ST));
- } break;
+ break;
default:
break;
}
@@ -847,20 +847,20 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
printBinaryBlockWithRelocs("SubSectionContents", Section, SectionContents,
Contents);
- switch (ModuleDebugFragmentKind(SubType)) {
- case ModuleDebugFragmentKind::Symbols:
+ switch (DebugSubsectionKind(SubType)) {
+ case DebugSubsectionKind::Symbols:
printCodeViewSymbolsSubsection(Contents, Section, SectionContents);
break;
- case ModuleDebugFragmentKind::InlineeLines:
+ case DebugSubsectionKind::InlineeLines:
printCodeViewInlineeLines(Contents);
break;
- case ModuleDebugFragmentKind::FileChecksums:
+ case DebugSubsectionKind::FileChecksums:
printCodeViewFileChecksums(Contents);
break;
- case ModuleDebugFragmentKind::Lines: {
+ case DebugSubsectionKind::Lines: {
// Holds a PC to file:line table. Some data to parse this subsection is
// stored in the other subsections, so just check sanity and store the
// pointers for deferred processing.
@@ -886,34 +886,33 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
FunctionNames.push_back(LinkageName);
break;
}
- case ModuleDebugFragmentKind::FrameData: {
+ case DebugSubsectionKind::FrameData: {
// First four bytes is a relocation against the function.
BinaryStreamReader SR(Contents, llvm::support::little);
- const uint32_t *CodePtr;
- error(SR.readObject(CodePtr));
+
+ DebugFrameDataSubsectionRef FrameData;
+ error(FrameData.initialize(SR));
+
StringRef LinkageName;
error(resolveSymbolName(Obj->getCOFFSection(Section), SectionContents,
- CodePtr, LinkageName));
+ FrameData.getRelocPtr(), LinkageName));
W.printString("LinkageName", LinkageName);
// To find the active frame description, search this array for the
// smallest PC range that includes the current PC.
- while (!SR.empty()) {
- const FrameData *FD;
- error(SR.readObject(FD));
-
- StringRef FrameFunc = error(CVStringTable.getString(FD->FrameFunc));
+ for (const auto &FD : FrameData) {
+ StringRef FrameFunc = error(CVStringTable.getString(FD.FrameFunc));
DictScope S(W, "FrameData");
- W.printHex("RvaStart", FD->RvaStart);
- W.printHex("CodeSize", FD->CodeSize);
- W.printHex("LocalSize", FD->LocalSize);
- W.printHex("ParamsSize", FD->ParamsSize);
- W.printHex("MaxStackSize", FD->MaxStackSize);
+ W.printHex("RvaStart", FD.RvaStart);
+ W.printHex("CodeSize", FD.CodeSize);
+ W.printHex("LocalSize", FD.LocalSize);
+ W.printHex("ParamsSize", FD.ParamsSize);
+ W.printHex("MaxStackSize", FD.MaxStackSize);
W.printString("FrameFunc", FrameFunc);
- W.printHex("PrologSize", FD->PrologSize);
- W.printHex("SavedRegsSize", FD->SavedRegsSize);
- W.printFlags("Flags", FD->Flags, makeArrayRef(FrameDataFlags));
+ W.printHex("PrologSize", FD.PrologSize);
+ W.printHex("SavedRegsSize", FD.SavedRegsSize);
+ W.printFlags("Flags", FD.Flags, makeArrayRef(FrameDataFlags));
}
break;
}
@@ -934,7 +933,7 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
BinaryStreamReader Reader(FunctionLineTables[Name], support::little);
- ModuleDebugLineFragmentRef LineInfo;
+ DebugLinesSubsectionRef LineInfo;
error(LineInfo.initialize(Reader));
W.printHex("Flags", LineInfo.header()->Flags);
@@ -996,9 +995,9 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection,
}
void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) {
- BinaryStreamReader SR(Subsection, llvm::support::little);
- ModuleDebugFileChecksumFragmentRef Checksums;
- error(Checksums.initialize(SR));
+ BinaryStreamRef Stream(Subsection, llvm::support::little);
+ DebugChecksumsSubsectionRef Checksums;
+ error(Checksums.initialize(Stream));
for (auto &FC : Checksums) {
DictScope S(W, "FileChecksum");
@@ -1015,7 +1014,7 @@ void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) {
void COFFDumper::printCodeViewInlineeLines(StringRef Subsection) {
BinaryStreamReader SR(Subsection, llvm::support::little);
- ModuleDebugInlineeLineFragmentRef Lines;
+ DebugInlineeLinesSubsectionRef Lines;
error(Lines.initialize(SR));
for (auto &Line : Lines) {
@@ -1039,7 +1038,7 @@ StringRef COFFDumper::getFileNameForFileOffset(uint32_t FileOffset) {
if (!CVFileChecksumTable.valid() || !CVStringTable.valid())
error(object_error::parse_failed);
- auto Iter = CVFileChecksumTable.at(FileOffset);
+ auto Iter = CVFileChecksumTable.getArray().at(FileOffset);
// Check if the file checksum table offset is valid.
if (Iter == CVFileChecksumTable.end())
diff --git a/tools/llvm-readobj/CodeView.h b/tools/llvm-readobj/CodeView.h
deleted file mode 100644
index cf713962eb7fa..0000000000000
--- a/tools/llvm-readobj/CodeView.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//===-- CodeView.h - On-disk record types for CodeView ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// \brief This file provides data structures useful for consuming on-disk
-/// CodeView. It is based on information published by Microsoft at
-/// https://github.com/Microsoft/microsoft-pdb/.
-///
-//===----------------------------------------------------------------------===//
-
-// FIXME: Find a home for this in include/llvm/DebugInfo/CodeView/.
-
-#ifndef LLVM_READOBJ_CODEVIEW_H
-#define LLVM_READOBJ_CODEVIEW_H
-
-#include "llvm/DebugInfo/CodeView/CodeView.h"
-#include "llvm/DebugInfo/CodeView/TypeIndex.h"
-#include "llvm/Support/Endian.h"
-
-namespace llvm {
-namespace codeview {
-
-using llvm::support::ulittle16_t;
-using llvm::support::ulittle32_t;
-
-/// Data in the the SUBSEC_FRAMEDATA subection.
-struct FrameData {
- ulittle32_t RvaStart;
- ulittle32_t CodeSize;
- ulittle32_t LocalSize;
- ulittle32_t ParamsSize;
- ulittle32_t MaxStackSize;
- ulittle32_t FrameFunc;
- ulittle16_t PrologSize;
- ulittle16_t SavedRegsSize;
- ulittle32_t Flags;
- enum : uint32_t {
- HasSEH = 1 << 0,
- HasEH = 1 << 1,
- IsFunctionStart = 1 << 2,
- };
-};
-
-
-} // namespace codeview
-} // namespace llvm
-
-#endif // LLVM_READOBJ_CODEVIEW_H