DebugSymbolsSubsection.h revision 319230
1319230Sdim//===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===//
2319230Sdim//
3319230Sdim//                     The LLVM Compiler Infrastructure
4319230Sdim//
5319230Sdim// This file is distributed under the University of Illinois Open Source
6319230Sdim// License. See LICENSE.TXT for details.
7319230Sdim//
8319230Sdim//===----------------------------------------------------------------------===//
9319230Sdim
10319230Sdim#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
11319230Sdim#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
12319230Sdim
13319230Sdim#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
14319230Sdim#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
15319230Sdim#include "llvm/Support/Error.h"
16319230Sdim
17319230Sdimnamespace llvm {
18319230Sdimnamespace codeview {
19319230Sdimclass DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
20319230Sdimpublic:
21319230Sdim  DebugSymbolsSubsectionRef()
22319230Sdim      : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
23319230Sdim
24319230Sdim  static bool classof(const DebugSubsectionRef *S) {
25319230Sdim    return S->kind() == DebugSubsectionKind::Symbols;
26319230Sdim  }
27319230Sdim
28319230Sdim  Error initialize(BinaryStreamReader Reader);
29319230Sdim
30319230Sdimprivate:
31319230Sdim  CVSymbolArray Records;
32319230Sdim};
33319230Sdim
34319230Sdimclass DebugSymbolsSubsection final : public DebugSubsection {
35319230Sdimpublic:
36319230Sdim  DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
37319230Sdim  static bool classof(const DebugSubsection *S) {
38319230Sdim    return S->kind() == DebugSubsectionKind::Symbols;
39319230Sdim  }
40319230Sdim
41319230Sdim  uint32_t calculateSerializedSize() const override;
42319230Sdim  Error commit(BinaryStreamWriter &Writer) const override;
43319230Sdim
44319230Sdim  void addSymbol(CVSymbol Symbol);
45319230Sdim
46319230Sdimprivate:
47319230Sdim  uint32_t Length = 0;
48319230Sdim  std::vector<CVSymbol> Records;
49319230Sdim};
50319230Sdim}
51319230Sdim}
52319230Sdim
53319230Sdim#endif
54