LLVM  15.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 
23 namespace llvm {
24 class BinaryStreamReader;
25 class BinaryStreamWriter;
26 
27 namespace codeview {
28 
30  const CrossModuleImport *Header = nullptr;
32 };
33 
34 } // end namespace codeview
35 
36 template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
37 public:
38  using ContextType = void;
39 
42 };
43 
44 namespace codeview {
45 
46 class DebugStringTableSubsection;
47 
51 
52 public:
55 
56  static bool classof(const DebugSubsectionRef *S) {
57  return S->kind() == DebugSubsectionKind::CrossScopeImports;
58  }
59 
62 
63  Iterator begin() const { return References.begin(); }
64  Iterator end() const { return References.end(); }
65 
66 private:
67  ReferenceArray References;
68 };
69 
71 public:
75  Strings(Strings) {}
76 
77  static bool classof(const DebugSubsection *S) {
78  return S->kind() == DebugSubsectionKind::CrossScopeImports;
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 
86 private:
89 };
90 
91 } // end namespace codeview
92 
93 } // end namespace llvm
94 
95 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::codeview::DebugCrossModuleImportsSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugCrossImpSubsection.cpp:44
StringRef.h
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:30
Error.h
llvm::codeview::DebugStringTableSubsection
Represents a read-write view of a CodeView string table.
Definition: DebugStringTableSubsection.h:56
llvm::VarStreamArray::end
Iterator end() const
Definition: BinaryStreamArray.h:115
llvm::VarStreamArrayExtractor
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic.
Definition: DbiModuleDescriptor.h:18
llvm::FixedStreamArray< support::ulittle32_t >
llvm::codeview::CrossModuleImportItem
Definition: DebugCrossImpSubsection.h:29
llvm::codeview::CrossModuleImportItem::Imports
FixedStreamArray< support::ulittle32_t > Imports
Definition: DebugCrossImpSubsection.h:31
llvm::codeview::CrossModuleImport
Definition: CodeView.h:603
llvm::codeview::DebugCrossModuleImportsSubsection::calculateSerializedSize
uint32_t calculateSerializedSize() const override
Definition: DebugCrossImpSubsection.cpp:63
llvm::codeview::DebugSubsectionKind::CrossScopeImports
@ CrossScopeImports
llvm::codeview::CrossModuleImportItem::Header
const CrossModuleImport * Header
Definition: DebugCrossImpSubsection.h:30
llvm::VarStreamArray< CrossModuleImportItem >
llvm::codeview::DebugSubsectionRef
Definition: DebugSubsection.h:21
llvm::VarStreamArray< CrossModuleImportItem >::Iterator
VarStreamArrayIterator< CrossModuleImportItem, VarStreamArrayExtractor< CrossModuleImportItem > > Iterator
Definition: BinaryStreamArray.h:96
llvm::VarStreamArrayExtractor::operator()
Error operator()(BinaryStreamRef Stream, uint32_t &Len, T &Item) const =delete
Definition: DebugChecksumsSubsection.cpp:35
StringMap.h
CodeView.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef::begin
Iterator begin() const
Definition: DebugCrossImpSubsection.h:63
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:110
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
DebugSubsection.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef::DebugCrossModuleImportsSubsectionRef
DebugCrossModuleImportsSubsectionRef()
Definition: DebugCrossImpSubsection.h:53
BinaryStreamArray.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef
Definition: DebugCrossImpSubsection.h:48
llvm::VarStreamArrayIterator
VarStreamArray represents an array of variable length records backed by a stream.
Definition: BinaryStreamArray.h:88
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::codeview::DebugCrossModuleImportsSubsection::commit
Error commit(BinaryStreamWriter &Writer) const override
Definition: DebugCrossImpSubsection.cpp:72
llvm::codeview::DebugCrossModuleImportsSubsectionRef::end
Iterator end() const
Definition: DebugCrossImpSubsection.h:64
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
BinaryStreamRef.h
llvm::codeview::DebugCrossModuleImportsSubsection
Definition: DebugCrossImpSubsection.h:70
uint32_t
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::VarStreamArray::begin
Iterator begin(bool *HadError=nullptr) const
Definition: BinaryStreamArray.h:108
llvm::codeview::DebugCrossModuleImportsSubsection::classof
static bool classof(const DebugSubsection *S)
Definition: DebugCrossImpSubsection.h:77
llvm::codeview::DebugSubsection
Definition: DebugSubsection.h:34
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::codeview::DebugSubsectionKind
DebugSubsectionKind
Definition: CodeView.h:315
llvm::VarStreamArrayExtractor< codeview::CrossModuleImportItem >::ContextType
void ContextType
Definition: DebugCrossImpSubsection.h:38
Endian.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef::classof
static bool classof(const DebugSubsectionRef *S)
Definition: DebugCrossImpSubsection.h:56
llvm::BinaryStreamRef
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Definition: BinaryStreamRef.h:155
llvm::codeview::DebugCrossModuleImportsSubsection::DebugCrossModuleImportsSubsection
DebugCrossModuleImportsSubsection(DebugStringTableSubsection &Strings)
Definition: DebugCrossImpSubsection.h:72
llvm::codeview::DebugCrossModuleImportsSubsection::addImport
void addImport(StringRef Module, uint32_t ImportId)
Definition: DebugCrossImpSubsection.cpp:54