[llvm-pdbdump] Abstract some of the YAML/Raw printing code.

There is a lot of duplicate code for printing line info between
YAML and the raw output printer.  This introduces a base class
that can be shared between the two, and makes some minor
cleanups in the process.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301728 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2017-04-29 01:13:21 +00:00
parent e85d77f956
commit 40d2ca9f43
22 changed files with 416 additions and 266 deletions

View File

@@ -1,5 +1,4 @@
//===- ModuleDebugLineFragment.cpp --------------------------------*- C++
//-*-===//
//===- ModuleDebugLineFragment.cpp -------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -24,7 +23,7 @@ Error LineColumnExtractor::extract(BinaryStreamRef Stream, uint32_t &Len,
BinaryStreamReader Reader(Stream);
if (auto EC = Reader.readObject(BlockHeader))
return EC;
bool HasColumn = Header->Flags & uint32_t(LineFlags::HaveColumns);
bool HasColumn = Header->Flags & uint16_t(LF_HaveColumns);
uint32_t LineInfoSize =
BlockHeader->NumLines *
(sizeof(LineNumberEntry) + (HasColumn ? sizeof(ColumnNumberEntry) : 0));
@@ -61,3 +60,7 @@ Error ModuleDebugLineFragment::initialize(BinaryStreamReader Reader) {
return Error::success();
}
bool ModuleDebugLineFragment::hasColumnInfo() const {
return Header->Flags & LF_HaveColumns;
}