]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / DebugSymbolsSubsection.h
1 //===- DebugSymbolsSubsection.h --------------------------------*- 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_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
11 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
12
13 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
14 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
15 #include "llvm/Support/Error.h"
16
17 namespace llvm {
18 namespace codeview {
19 class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
20 public:
21   DebugSymbolsSubsectionRef()
22       : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
23
24   static bool classof(const DebugSubsectionRef *S) {
25     return S->kind() == DebugSubsectionKind::Symbols;
26   }
27
28   Error initialize(BinaryStreamReader Reader);
29
30 private:
31   CVSymbolArray Records;
32 };
33
34 class DebugSymbolsSubsection final : public DebugSubsection {
35 public:
36   DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
37   static bool classof(const DebugSubsection *S) {
38     return S->kind() == DebugSubsectionKind::Symbols;
39   }
40
41   uint32_t calculateSerializedSize() const override;
42   Error commit(BinaryStreamWriter &Writer) const override;
43
44   void addSymbol(CVSymbol Symbol);
45
46 private:
47   uint32_t Length = 0;
48   std::vector<CVSymbol> Records;
49 };
50 }
51 }
52
53 #endif