LLVM 22.0.0git
AppendingTypeTableBuilder.h
Go to the documentation of this file.
1//===- AppendingTypeTableBuilder.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_APPENDINGTYPETABLEBUILDER_H
10#define LLVM_DEBUGINFO_CODEVIEW_APPENDINGTYPETABLEBUILDER_H
11
12#include "llvm/ADT/ArrayRef.h"
20#include <cstdint>
21
22namespace llvm {
23namespace codeview {
24
26
28
29 BumpPtrAllocator &RecordStorage;
30 SimpleTypeSerializer SimpleSerializer;
31
32 /// Contains a list of all records indexed by TypeIndex.toArrayIndex().
33 SmallVector<ArrayRef<uint8_t>, 2> SeenRecords;
34
35public:
38
39 // TypeCollection overrides
40 std::optional<TypeIndex> getFirst() override;
41 std::optional<TypeIndex> getNext(TypeIndex Prev) override;
42 CVType getType(TypeIndex Index) override;
43 StringRef getTypeName(TypeIndex Index) override;
44 bool contains(TypeIndex Index) override;
45 uint32_t size() override;
46 uint32_t capacity() override;
47 bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) override;
48
49 // public interface
50 void reset();
52
53 BumpPtrAllocator &getAllocator() { return RecordStorage; }
54
55 ArrayRef<ArrayRef<uint8_t>> records() const;
56 TypeIndex insertRecordBytes(ArrayRef<uint8_t> &Record);
57 TypeIndex insertRecord(ContinuationRecordBuilder &Builder);
58
59 template <typename T> TypeIndex writeLeafType(T &Record) {
60 ArrayRef<uint8_t> Data = SimpleSerializer.serialize(Record);
61 return insertRecordBytes(Data);
62 }
63};
64
65} // end namespace codeview
66} // end namespace llvm
67
68#endif // LLVM_DEBUGINFO_CODEVIEW_APPENDINGTYPETABLEBUILDER_H
This file defines the BumpPtrAllocator interface.
#define LLVM_ABI
Definition Compiler.h:213
static std::string getTypeName(OverloadKind Kind, Type *Ty)
#define T
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
Definition Value.cpp:480
This file defines the SmallVector class.
static SymbolRef::Type getType(const Symbol *Sym)
Definition TapiFile.cpp:39
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
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.
Definition StringRef.h:55
std::optional< TypeIndex > getFirst() override
std::optional< TypeIndex > getNext(TypeIndex Prev) override
TypeIndex insertRecordBytes(ArrayRef< uint8_t > &Record)
bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) override
A 32-bit type reference.
Definition TypeIndex.h:97
CVRecord< TypeLeafKind > CVType
Definition CVRecord.h:64
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383
FunctionAddr VTableAddr uintptr_t uintptr_t Data
Definition InstrProf.h:189