File indexing completed on 2026-05-10 08:43:39
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
0011
0012 #include "llvm/DebugInfo/CodeView/CodeView.h"
0013 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
0014 #include "llvm/Support/BinaryStreamArray.h"
0015 #include "llvm/Support/BinaryStreamRef.h"
0016 #include "llvm/Support/Error.h"
0017 #include <cstdint>
0018 #include <map>
0019
0020 namespace llvm {
0021 class BinaryStreamReader;
0022 class BinaryStreamWriter;
0023 namespace codeview {
0024
0025 class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
0026 using ReferenceArray = FixedStreamArray<CrossModuleExport>;
0027 using Iterator = ReferenceArray::Iterator;
0028
0029 public:
0030 DebugCrossModuleExportsSubsectionRef()
0031 : DebugSubsectionRef(DebugSubsectionKind::CrossScopeExports) {}
0032
0033 static bool classof(const DebugSubsectionRef *S) {
0034 return S->kind() == DebugSubsectionKind::CrossScopeExports;
0035 }
0036
0037 Error initialize(BinaryStreamReader Reader);
0038 Error initialize(BinaryStreamRef Stream);
0039
0040 Iterator begin() const { return References.begin(); }
0041 Iterator end() const { return References.end(); }
0042
0043 private:
0044 FixedStreamArray<CrossModuleExport> References;
0045 };
0046
0047 class DebugCrossModuleExportsSubsection final : public DebugSubsection {
0048 public:
0049 DebugCrossModuleExportsSubsection()
0050 : DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
0051
0052 static bool classof(const DebugSubsection *S) {
0053 return S->kind() == DebugSubsectionKind::CrossScopeExports;
0054 }
0055
0056 void addMapping(uint32_t Local, uint32_t Global);
0057
0058 uint32_t calculateSerializedSize() const override;
0059 Error commit(BinaryStreamWriter &Writer) const override;
0060
0061 private:
0062 std::map<uint32_t, uint32_t> Mappings;
0063 };
0064
0065 }
0066 }
0067
0068 #endif