1//===- DebugSymbolRVASubsection.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_DEBUGSYMBOLRVASUBSECTION_H
11#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLRVASUBSECTION_H
12
13#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
14#include "llvm/Support/BinaryStreamArray.h"
15#include "llvm/Support/BinaryStreamReader.h"
16#include "llvm/Support/Error.h"
17
18namespace llvm {
19namespace codeview {
20
21class DebugSymbolRVASubsectionRef final : public DebugSubsectionRef {
22public:
23  typedef FixedStreamArray<support::ulittle32_t> ArrayType;
24
25  DebugSymbolRVASubsectionRef();
26
27  static bool classof(const DebugSubsectionRef *S) {
28    return S->kind() == DebugSubsectionKind::CoffSymbolRVA;
29  }
30
31  ArrayType::Iterator begin() const { return RVAs.begin(); }
32  ArrayType::Iterator end() const { return RVAs.end(); }
33
34  Error initialize(BinaryStreamReader &Reader);
35
36private:
37  ArrayType RVAs;
38};
39
40class DebugSymbolRVASubsection final : public DebugSubsection {
41public:
42  DebugSymbolRVASubsection();
43
44  static bool classof(const DebugSubsection *S) {
45    return S->kind() == DebugSubsectionKind::CoffSymbolRVA;
46  }
47
48  Error commit(BinaryStreamWriter &Writer) const override;
49  uint32_t calculateSerializedSize() const override;
50
51  void addRVA(uint32_t RVA) { RVAs.push_back(support::ulittle32_t(RVA)); }
52
53private:
54  std::vector<support::ulittle32_t> RVAs;
55};
56} // namespace codeview
57} // namespace llvm
58
59#endif
60