LLVM  14.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 
24 namespace llvm {
25 
26 namespace codeview {
27 
29  const CrossModuleImport *Header = nullptr;
31 };
32 
33 } // end namespace codeview
34 
35 template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
36 public:
37  using ContextType = void;
38 
41 };
42 
43 namespace codeview {
44 
45 class DebugStringTableSubsection;
46 
50 
51 public:
54 
55  static bool classof(const DebugSubsectionRef *S) {
56  return S->kind() == DebugSubsectionKind::CrossScopeImports;
57  }
58 
61 
62  Iterator begin() const { return References.begin(); }
63  Iterator end() const { return References.end(); }
64 
65 private:
66  ReferenceArray References;
67 };
68 
70 public:
74  Strings(Strings) {}
75 
76  static bool classof(const DebugSubsection *S) {
77  return S->kind() == DebugSubsectionKind::CrossScopeImports;
78  }
79 
80  void addImport(StringRef Module, uint32_t ImportId);
81 
82  uint32_t calculateSerializedSize() const override;
83  Error commit(BinaryStreamWriter &Writer) const override;
84 
85 private:
88 };
89 
90 } // end namespace codeview
91 
92 } // end namespace llvm
93 
94 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
BinaryStreamReader.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
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:31
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: BinaryStreamArray.h:47
llvm::FixedStreamArray< support::ulittle32_t >
llvm::codeview::CrossModuleImportItem
Definition: DebugCrossImpSubsection.h:28
llvm::codeview::CrossModuleImportItem::Imports
FixedStreamArray< support::ulittle32_t > Imports
Definition: DebugCrossImpSubsection.h:30
llvm::codeview::CrossModuleImport
Definition: CodeView.h:601
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:29
llvm::VarStreamArray< CrossModuleImportItem >
llvm::codeview::DebugSubsectionRef
Definition: DebugSubsection.h:19
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:62
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
DebugSubsection.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef::DebugCrossModuleImportsSubsectionRef
DebugCrossModuleImportsSubsectionRef()
Definition: DebugCrossImpSubsection.h:52
BinaryStreamArray.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef
Definition: DebugCrossImpSubsection.h:47
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:67
llvm::codeview::DebugCrossModuleImportsSubsection::commit
Error commit(BinaryStreamWriter &Writer) const override
Definition: DebugCrossImpSubsection.cpp:72
llvm::codeview::DebugCrossModuleImportsSubsectionRef::end
Iterator end() const
Definition: DebugCrossImpSubsection.h:63
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
BinaryStreamRef.h
llvm::codeview::DebugCrossModuleImportsSubsection
Definition: DebugCrossImpSubsection.h:69
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:76
llvm::codeview::DebugSubsection
Definition: DebugSubsection.h:32
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::codeview::DebugSubsectionKind
DebugSubsectionKind
Definition: CodeView.h:313
llvm::VarStreamArrayExtractor< codeview::CrossModuleImportItem >::ContextType
void ContextType
Definition: DebugCrossImpSubsection.h:37
Endian.h
llvm::codeview::DebugCrossModuleImportsSubsectionRef::classof
static bool classof(const DebugSubsectionRef *S)
Definition: DebugCrossImpSubsection.h:55
llvm::BinaryStreamRef
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Definition: BinaryStreamRef.h:156
llvm::codeview::DebugCrossModuleImportsSubsection::DebugCrossModuleImportsSubsection
DebugCrossModuleImportsSubsection(DebugStringTableSubsection &Strings)
Definition: DebugCrossImpSubsection.h:71
llvm::codeview::DebugCrossModuleImportsSubsection::addImport
void addImport(StringRef Module, uint32_t ImportId)
Definition: DebugCrossImpSubsection.cpp:54