LLVM: include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_GLOBALTYPETABLEBUILDER_H
10#define LLVM_DEBUGINFO_CODEVIEW_GLOBALTYPETABLEBUILDER_H
11
22#include
23#include
24
25namespace llvm {
27
29
31
33
34
35
36
38
39
41
42
44
45
47
48public:
51
52
53 std::optional getFirst() override;
61
62
65
67
70
71 template
73 CreateFunc Create) {
74 assert(RecordSize < UINT32_MAX && "Record too big");
75 assert(RecordSize % 4 == 0 &&
76 "RecordSize is not a multiple of 4 bytes which will cause "
77 "misalignment in the output TPI stream!");
78
79 auto Result = HashedRecords.try_emplace(Hash, nextTypeIndex());
80
82 Result.first->second.isSimple())) {
83 uint8_t *Stable = RecordStorage.Allocate<uint8_t>(RecordSize);
86 if (StableRecord.empty()) {
87
88
91 }
92 if (Result.first->second.isSimple()) {
93 assert(Result.first->second.getIndex() ==
95
96
97
98
100 }
101 SeenRecords.push_back(StableRecord);
102 SeenHashes.push_back(Hash);
103 }
104
105 return Result.first->second;
106 }
107
110
115};
116
117}
118}
119
120#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the BumpPtrAllocator interface.
#define LLVM_UNLIKELY(EXPR)
static std::string getTypeName(OverloadKind Kind, Type *Ty)
This file defines the DenseMap class.
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
This file defines the SmallVector class.
static SymbolRef::Type getType(const Symbol *Sym)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool empty() const
empty - Check if the array is empty.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
~GlobalTypeTableBuilder() override
std::optional< TypeIndex > getNext(TypeIndex Prev) override
BumpPtrAllocator & getAllocator()
Definition GlobalTypeTableBuilder.h:66
uint32_t capacity() override
TypeIndex insertRecordBytes(ArrayRef< uint8_t > Data)
TypeIndex insertRecordAs(GloballyHashedType Hash, size_t RecordSize, CreateFunc Create)
Definition GlobalTypeTableBuilder.h:72
TypeIndex nextTypeIndex() const
GlobalTypeTableBuilder(BumpPtrAllocator &Storage)
bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) override
TypeIndex writeLeafType(T &Record)
Definition GlobalTypeTableBuilder.h:111
std::optional< TypeIndex > getFirst() override
CVRecord< TypeLeafKind > CVType
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
A globally hashed type represents a hash value that is sufficient to uniquely identify a record acros...