1 //===- DebugCrossExSubsection.h ---------------------------------*- C++ -*-===//
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
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"
24 class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
25 using ReferenceArray = FixedStreamArray<CrossModuleExport>;
26 using Iterator = ReferenceArray::Iterator;
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(); }
43 FixedStreamArray<CrossModuleExport> References;
46 class DebugCrossModuleExportsSubsection final : public DebugSubsection {
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;
61 std::map<uint32_t, uint32_t> Mappings;
64 } // end namespace codeview
65 } // end namespace llvm
67 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H