diff options
author | Zachary Turner <zturner@google.com> | 2017-06-08 23:49:01 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-08 23:49:01 +0000 |
commit | 1bf776204926ca9293d2269ee28c21f0543b7941 (patch) | |
tree | e254c189233bd68331667b426595ce8543c33742 /llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp | |
parent | 67aea737f3ee37fd0c39c3a59cef857dcabad231 (diff) | |
download | bcm5719-llvm-1bf776204926ca9293d2269ee28c21f0543b7941.tar.gz bcm5719-llvm-1bf776204926ca9293d2269ee28c21f0543b7941.zip |
[llvm-pdbdump] Support native ordering of subsections in raw mode.
This is the same change for the YAML Output style applied to the
raw output style. Previously we would queue up all subsections
until every one had been read, and then output them in a pre-
determined order. This was because some subsections need to be
read first in order to properly dump later subsections. This
patch allows them to be dumped in the order they appear.
Differential Revision: https://reviews.llvm.org/D34015
llvm-svn: 305034
Diffstat (limited to 'llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp b/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp deleted file mode 100644 index 3113a3250f0..00000000000 --- a/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp +++ /dev/null @@ -1,105 +0,0 @@ -//===- C13DebugFragmentVisitor.cpp -------------------------------*- C++-*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "C13DebugFragmentVisitor.h" - -#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h" -#include "llvm/DebugInfo/CodeView/DebugCrossExSubsection.h" -#include "llvm/DebugInfo/CodeView/DebugCrossImpSubsection.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" - -using namespace llvm; -using namespace llvm::codeview; -using namespace llvm::pdb; - -C13DebugFragmentVisitor::C13DebugFragmentVisitor(PDBFile &F) : F(F) {} - -C13DebugFragmentVisitor::~C13DebugFragmentVisitor() {} - -Error C13DebugFragmentVisitor::visitUnknown( - codeview::DebugUnknownSubsectionRef &Fragment) { - return Error::success(); -} - -Error C13DebugFragmentVisitor::visitFileChecksums( - codeview::DebugChecksumsSubsectionRef &Checksums) { - assert(!this->Checksums.hasValue()); - this->Checksums = Checksums; - return Error::success(); -} - -Error C13DebugFragmentVisitor::visitLines( - codeview::DebugLinesSubsectionRef &Lines) { - this->Lines.push_back(Lines); - return Error::success(); -} - -Error C13DebugFragmentVisitor::visitInlineeLines( - codeview::DebugInlineeLinesSubsectionRef &Lines) { - this->InlineeLines.push_back(Lines); - return Error::success(); -} - -Error C13DebugFragmentVisitor::visitCrossModuleExports( - codeview::DebugCrossModuleExportsSubsectionRef &Exports) { - this->CrossExports.push_back(Exports); - return Error::success(); -} - -Error C13DebugFragmentVisitor::visitCrossModuleImports( - codeview::DebugCrossModuleImportsSubsectionRef &Imports) { - this->CrossImports.push_back(Imports); - return Error::success(); -} - -Error C13DebugFragmentVisitor::finished() { - if (Checksums.hasValue()) { - if (auto EC = handleFileChecksums()) - return EC; - - if (auto EC = handleLines()) - return EC; - - if (auto EC = handleInlineeLines()) - return EC; - } - - if (auto EC = handleCrossModuleExports()) - return EC; - - if (auto EC = handleCrossModuleImports()) - return EC; - - return Error::success(); -} - -Expected<StringRef> -C13DebugFragmentVisitor::getNameFromStringTable(uint32_t Offset) { - auto ST = F.getStringTable(); - if (!ST) - return ST.takeError(); - - return ST->getStringForID(Offset); -} - -Expected<StringRef> -C13DebugFragmentVisitor::getNameFromChecksumsBuffer(uint32_t Offset) { - assert(Checksums.hasValue()); - - auto Array = Checksums->getArray(); - auto ChecksumIter = Array.at(Offset); - if (ChecksumIter == Array.end()) - return make_error<RawError>(raw_error_code::invalid_format); - const auto &Entry = *ChecksumIter; - return getNameFromStringTable(Entry.FileNameOffset); -} |