summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-29 01:13:21 +0000
committerZachary Turner <zturner@google.com>2017-04-29 01:13:21 +0000
commit5b6e4e0aed43017079f854d9909e2c8a0e4e1a07 (patch)
tree9784242c8790de5e617fb6c27240f13cb18d8b91 /llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
parentc7cacdc3327de057bfa25d2195cce1f8146e8769 (diff)
downloadbcm5719-llvm-5b6e4e0aed43017079f854d9909e2c8a0e4e1a07.tar.gz
bcm5719-llvm-5b6e4e0aed43017079f854d9909e2c8a0e4e1a07.zip
[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. llvm-svn: 301728
Diffstat (limited to 'llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h')
-rw-r--r--llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h b/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
new file mode 100644
index 00000000000..e4a51ce2adc
--- /dev/null
+++ b/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
@@ -0,0 +1,55 @@
+//===- C13DebugFragmentVisitor.h - Visitor for CodeView Info ----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H
+#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/Support/Error.h"
+
+#include <vector>
+
+namespace llvm {
+
+namespace pdb {
+
+class PDBFile;
+
+class C13DebugFragmentVisitor : public codeview::ModuleDebugFragmentVisitor {
+public:
+ C13DebugFragmentVisitor(PDBFile &F);
+ ~C13DebugFragmentVisitor();
+
+ Error visitUnknown(codeview::ModuleDebugUnknownFragment &Fragment) final;
+
+ Error visitFileChecksums(
+ codeview::ModuleDebugFileChecksumFragment &Checksums) final;
+
+ Error visitLines(codeview::ModuleDebugLineFragment &Lines) final;
+
+ Error finished() final;
+
+protected:
+ virtual Error handleFileChecksums() { return Error::success(); }
+ virtual Error handleLines() { return Error::success(); }
+
+ Expected<StringRef> getNameFromStringTable(uint32_t Offset);
+ Expected<StringRef> getNameFromChecksumsBuffer(uint32_t Offset);
+
+ Optional<codeview::ModuleDebugFileChecksumFragment> Checksums;
+ std::vector<codeview::ModuleDebugLineFragment> Lines;
+
+ PDBFile &F;
+};
+}
+}
+
+#endif
OpenPOWER on IntegriCloud