[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / DebugInfo / CodeView / DebugCrossExSubsection.h
blob64a78a7cef214e11ad31b5c6bf568a04e644b406
1 //===- DebugCrossExSubsection.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_DEBUGCROSSEXSUBSECTION_H
10 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_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/BinaryStreamReader.h"
16 #include "llvm/Support/BinaryStreamRef.h"
17 #include "llvm/Support/Error.h"
18 #include <cstdint>
19 #include <map>
21 namespace llvm {
22 namespace codeview {
24 class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
25 using ReferenceArray = FixedStreamArray<CrossModuleExport>;
26 using Iterator = ReferenceArray::Iterator;
28 public:
29 DebugCrossModuleExportsSubsectionRef()
30 : DebugSubsectionRef(DebugSubsectionKind::CrossScopeExports) {}
32 static bool classof(const DebugSubsectionRef *S) {
33 return S->kind() == DebugSubsectionKind::CrossScopeExports;
36 Error initialize(BinaryStreamReader Reader);
37 Error initialize(BinaryStreamRef Stream);
39 Iterator begin() const { return References.begin(); }
40 Iterator end() const { return References.end(); }
42 private:
43 FixedStreamArray<CrossModuleExport> References;
46 class DebugCrossModuleExportsSubsection final : public DebugSubsection {
47 public:
48 DebugCrossModuleExportsSubsection()
49 : DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
51 static bool classof(const DebugSubsection *S) {
52 return S->kind() == DebugSubsectionKind::CrossScopeExports;
55 void addMapping(uint32_t Local, uint32_t Global);
57 uint32_t calculateSerializedSize() const override;
58 Error commit(BinaryStreamWriter &Writer) const override;
60 private:
61 std::map<uint32_t, uint32_t> Mappings;
64 } // end namespace codeview
65 } // end namespace llvm
67 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H