blob: dfda7deb6cb41934d1d9afe8fdb6e62e842d47b9 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- 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
17namespace llvm {
18namespace codeview {
19class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
20public:
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 CVSymbolArray::Iterator begin() const { return Records.begin(); }
31 CVSymbolArray::Iterator end() const { return Records.end(); }
32
33private:
34 CVSymbolArray Records;
35};
36
37class DebugSymbolsSubsection final : public DebugSubsection {
38public:
39 DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
40 static bool classof(const DebugSubsection *S) {
41 return S->kind() == DebugSubsectionKind::Symbols;
42 }
43
44 uint32_t calculateSerializedSize() const override;
45 Error commit(BinaryStreamWriter &Writer) const override;
46
47 void addSymbol(CVSymbol Symbol);
48
49private:
50 uint32_t Length = 0;
51 std::vector<CVSymbol> Records;
52};
53}
54}
55
56#endif