1 //===- DebugCrossExSubsection.h ---------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
11 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
13 #include "llvm/DebugInfo/CodeView/CodeView.h"
14 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
15 #include "llvm/Support/BinaryStreamArray.h"
16 #include "llvm/Support/BinaryStreamReader.h"
17 #include "llvm/Support/BinaryStreamRef.h"
18 #include "llvm/Support/Error.h"
25 class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
26 using ReferenceArray = FixedStreamArray<CrossModuleExport>;
27 using Iterator = ReferenceArray::Iterator;
30 DebugCrossModuleExportsSubsectionRef()
31 : DebugSubsectionRef(DebugSubsectionKind::CrossScopeExports) {}
33 static bool classof(const DebugSubsectionRef *S) {
34 return S->kind() == DebugSubsectionKind::CrossScopeExports;
37 Error initialize(BinaryStreamReader Reader);
38 Error initialize(BinaryStreamRef Stream);
40 Iterator begin() const { return References.begin(); }
41 Iterator end() const { return References.end(); }
44 FixedStreamArray<CrossModuleExport> References;
47 class DebugCrossModuleExportsSubsection final : public DebugSubsection {
49 DebugCrossModuleExportsSubsection()
50 : DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
52 static bool classof(const DebugSubsection *S) {
53 return S->kind() == DebugSubsectionKind::CrossScopeExports;
56 void addMapping(uint32_t Local, uint32_t Global);
58 uint32_t calculateSerializedSize() const override;
59 Error commit(BinaryStreamWriter &Writer) const override;
62 std::map<uint32_t, uint32_t> Mappings;
65 } // end namespace codeview
66 } // end namespace llvm
68 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H