]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-pdbdump / C13DebugFragmentVisitor.h
1 //===- C13DebugFragmentVisitor.h - Visitor for CodeView Info ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H
12
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
15 #include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h"
16 #include "llvm/Support/Error.h"
17
18 #include <vector>
19
20 namespace llvm {
21
22 namespace pdb {
23
24 class PDBFile;
25
26 class C13DebugFragmentVisitor : public codeview::DebugSubsectionVisitor {
27 public:
28   C13DebugFragmentVisitor(PDBFile &F);
29   ~C13DebugFragmentVisitor();
30
31   Error visitUnknown(codeview::DebugUnknownSubsectionRef &Fragment) final;
32
33   Error
34   visitFileChecksums(codeview::DebugChecksumsSubsectionRef &Checksums) final;
35
36   Error visitLines(codeview::DebugLinesSubsectionRef &Lines) final;
37
38   Error
39   visitInlineeLines(codeview::DebugInlineeLinesSubsectionRef &Lines) final;
40
41   Error finished() final;
42
43 protected:
44   virtual Error handleFileChecksums() { return Error::success(); }
45   virtual Error handleLines() { return Error::success(); }
46   virtual Error handleInlineeLines() { return Error::success(); }
47
48   Expected<StringRef> getNameFromStringTable(uint32_t Offset);
49   Expected<StringRef> getNameFromChecksumsBuffer(uint32_t Offset);
50
51   Optional<codeview::DebugChecksumsSubsectionRef> Checksums;
52   std::vector<codeview::DebugInlineeLinesSubsectionRef> InlineeLines;
53   std::vector<codeview::DebugLinesSubsectionRef> Lines;
54
55   PDBFile &F;
56 };
57 }
58 }
59
60 #endif