[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / DebugInfo / CodeView / DebugSymbolRVASubsection.h
blob91b740ce6b9aee4e9349eb8f472f7527bc2cde35
1 //===- DebugSymbolRVASubsection.h -------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLRVASUBSECTION_H
10 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLRVASUBSECTION_H
12 #include "llvm/DebugInfo/CodeView/CodeView.h"
13 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
14 #include "llvm/Support/BinaryStreamArray.h"
15 #include "llvm/Support/Endian.h"
16 #include "llvm/Support/Error.h"
17 #include <cstdint>
18 #include <vector>
20 namespace llvm {
22 class BinaryStreamReader;
24 namespace codeview {
26 class DebugSymbolRVASubsectionRef final : public DebugSubsectionRef {
27 public:
28 using ArrayType = FixedStreamArray<support::ulittle32_t>;
30 DebugSymbolRVASubsectionRef();
32 static bool classof(const DebugSubsectionRef *S) {
33 return S->kind() == DebugSubsectionKind::CoffSymbolRVA;
36 ArrayType::Iterator begin() const { return RVAs.begin(); }
37 ArrayType::Iterator end() const { return RVAs.end(); }
39 Error initialize(BinaryStreamReader &Reader);
41 private:
42 ArrayType RVAs;
45 class DebugSymbolRVASubsection final : public DebugSubsection {
46 public:
47 DebugSymbolRVASubsection();
49 static bool classof(const DebugSubsection *S) {
50 return S->kind() == DebugSubsectionKind::CoffSymbolRVA;
53 Error commit(BinaryStreamWriter &Writer) const override;
54 uint32_t calculateSerializedSize() const override;
56 void addRVA(uint32_t RVA) { RVAs.push_back(support::ulittle32_t(RVA)); }
58 private:
59 std::vector<support::ulittle32_t> RVAs;
62 } // end namespace codeview
64 } // end namespace llvm
66 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLRVASUBSECTION_H