LLVM 20.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"
18#include "llvm/Support/Endian.h"
19#include "llvm/Support/Error.h"
20#include <cstdint>
21#include <vector>
22
23namespace llvm {
24class BinaryStreamReader;
25class BinaryStreamWriter;
26
27namespace codeview {
28
30 const CrossModuleImport *Header = nullptr;
32};
33
34} // end namespace codeview
35
36template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
37public:
38 using ContextType = void;
39
42};
43
44namespace codeview {
45
46class DebugStringTableSubsection;
47
51
52public:
55
56 static bool classof(const DebugSubsectionRef *S) {
58 }
59
62
63 Iterator begin() const { return References.begin(); }
64 Iterator end() const { return References.end(); }
65
66private:
67 ReferenceArray References;
68};
69
71public:
75 Strings(Strings) {}
76
77 static bool classof(const DebugSubsection *S) {
79 }
80
81 void addImport(StringRef Module, uint32_t ImportId);
82
83 uint32_t calculateSerializedSize() const override;
84 Error commit(BinaryStreamWriter &Writer) const override;
85
86private:
89};
90
91} // end namespace codeview
92
93} // end namespace llvm
94
95#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
This file defines the StringMap class.
Lightweight arrays that are backed by an arbitrary BinaryStream.
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:160
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:65
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:128
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
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
static bool classof(const DebugSubsectionRef *S)
void addImport(StringRef Module, uint32_t ImportId)
DebugCrossModuleImportsSubsection(DebugStringTableSubsection &Strings)
Error commit(BinaryStreamWriter &Writer) const override
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
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