annotate include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 #include "llvm/Support/Error.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 namespace codeview {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 public:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 DebugSymbolsSubsectionRef()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 static bool classof(const DebugSubsectionRef *S) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 return S->kind() == DebugSubsectionKind::Symbols;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 Error initialize(BinaryStreamReader Reader);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 CVSymbolArray::Iterator begin() const { return Records.begin(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 CVSymbolArray::Iterator end() const { return Records.end(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 private:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 CVSymbolArray Records;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 class DebugSymbolsSubsection final : public DebugSubsection {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 public:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 static bool classof(const DebugSubsection *S) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 return S->kind() == DebugSubsectionKind::Symbols;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 uint32_t calculateSerializedSize() const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 Error commit(BinaryStreamWriter &Writer) const override;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 void addSymbol(CVSymbol Symbol);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 private:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 uint32_t Length = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 std::vector<CVSymbol> Records;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 #endif