9#ifndef LLVM_DEBUGINFO_CODEVIEW_GLOBALTYPETABLEBUILDER_H
10#define LLVM_DEBUGINFO_CODEVIEW_GLOBALTYPETABLEBUILDER_H
28class ContinuationRecordBuilder;
53 std::optional<TypeIndex> getFirst()
override;
54 std::optional<TypeIndex> getNext(
TypeIndex Prev)
override;
71 template <
typename CreateFunc>
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!");
79 auto Result = HashedRecords.
try_emplace(Hash, nextTypeIndex());
82 Result.first->second.isSimple())) {
86 if (StableRecord.
empty()) {
89 Result.first->getSecond() =
TypeIndex(SimpleTypeKind::NotTranslated);
90 return TypeIndex(SimpleTypeKind::NotTranslated);
92 if (Result.first->second.isSimple()) {
93 assert(Result.first->second.getIndex() ==
94 (
uint32_t)SimpleTypeKind::NotTranslated);
99 Result.first->second = nextTypeIndex();
105 return Result.first->second;
113 return insertRecordBytes(Data);
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.
Allocate memory in an ever growing pool, as if by bump-pointer.
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
void push_back(const T &Elt)
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.
BumpPtrAllocator & getAllocator()
TypeIndex insertRecordAs(GloballyHashedType Hash, size_t RecordSize, CreateFunc Create)
~GlobalTypeTableBuilder()
TypeIndex writeLeafType(T &Record)
ArrayRef< uint8_t > serialize(T &Record)
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
A globally hashed type represents a hash value that is sufficient to uniquely identify a record acros...