DebugSymbolsSubsection.h revision 319799
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
30319799Sdim  CVSymbolArray::Iterator begin() const { return Records.begin(); }
31319799Sdim  CVSymbolArray::Iterator end() const { return Records.end(); }
32319799Sdim
33319230Sdimprivate:
34319230Sdim  CVSymbolArray Records;
35319230Sdim};
36319230Sdim
37319230Sdimclass DebugSymbolsSubsection final : public DebugSubsection {
38319230Sdimpublic:
39319230Sdim  DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
40319230Sdim  static bool classof(const DebugSubsection *S) {
41319230Sdim    return S->kind() == DebugSubsectionKind::Symbols;
42319230Sdim  }
43319230Sdim
44319230Sdim  uint32_t calculateSerializedSize() const override;
45319230Sdim  Error commit(BinaryStreamWriter &Writer) const override;
46319230Sdim
47319230Sdim  void addSymbol(CVSymbol Symbol);
48319230Sdim
49319230Sdimprivate:
50319230Sdim  uint32_t Length = 0;
51319230Sdim  std::vector<CVSymbol> Records;
52319230Sdim};
53319230Sdim}
54319230Sdim}
55319230Sdim
56319230Sdim#endif
57