LLVM 22.0.0git
DebugCrossImpSubsection.h
Go to the documentation of this file.
1//===- DebugCrossImpSubsection.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//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
10#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
11
12#include "llvm/ADT/StringMap.h"
13#include "llvm/ADT/StringRef.h"
19#include "llvm/Support/Endian.h"
20#include "llvm/Support/Error.h"
21#include <cstdint>
22#include <vector>
23
24namespace llvm {
25class BinaryStreamReader;
26class BinaryStreamWriter;
27
28namespace codeview {
29
31 const CrossModuleImport *Header = nullptr;
33};
34
35} // end namespace codeview
36
37template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
38public:
39 using ContextType = void;
40
43};
44
45namespace codeview {
46
47class DebugStringTableSubsection;
48
52
53public:
56
57 static bool classof(const DebugSubsectionRef *S) {
59 }
60
63
64 Iterator begin() const { return References.begin(); }
65 Iterator end() const { return References.end(); }
66
67private:
68 ReferenceArray References;
69};
70
72 : public DebugSubsection {
73public:
77 Strings(Strings) {}
78
79 static bool classof(const DebugSubsection *S) {
80 return S->kind() == DebugSubsectionKind::CrossScopeImports;
81 }
82
83 void addImport(StringRef Module, uint32_t ImportId);
84
85 uint32_t calculateSerializedSize() const override;
86 Error commit(BinaryStreamWriter &Writer) const override;
87
88private:
91};
92
93} // end namespace codeview
94
95} // end namespace llvm
96
97#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
This file defines the StringMap class.
Lightweight arrays that are backed by an arbitrary BinaryStream.
#define LLVM_ABI
Definition: Compiler.h:213
Provides read only access to a subclass of BinaryStream.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Provides write only access to a subclass of WritableBinaryStream.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:133
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
VarStreamArray represents an array of variable length records backed by a stream.
Iterator end() const
VarStreamArrayIterator< CrossModuleImportItem, VarStreamArrayExtractor< CrossModuleImportItem > > Iterator
Iterator begin(bool *HadError=nullptr) const
LLVM_ABI Error initialize(BinaryStreamReader Reader)
static bool classof(const DebugSubsectionRef *S)
DebugCrossModuleImportsSubsection(DebugStringTableSubsection &Strings)
Represents a read-write view of a CodeView string table.
DebugSubsectionKind kind() const
DebugSubsectionKind kind() const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
LLVM_ABI Error operator()(BinaryStreamRef Stream, uint32_t &Len, codeview::CrossModuleImportItem &Item)
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic.
FixedStreamArray< support::ulittle32_t > Imports