xref: /freebsd/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===- TypeTableCollection.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_TYPETABLECOLLECTION_H
10 #define LLVM_DEBUGINFO_CODEVIEW_TYPETABLECOLLECTION_H
11 
12 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
13 #include "llvm/Support/Compiler.h"
14 #include "llvm/Support/StringSaver.h"
15 
16 #include <vector>
17 
18 namespace llvm {
19 namespace codeview {
20 
21 class LLVM_ABI TypeTableCollection : public TypeCollection {
22 public:
23   explicit TypeTableCollection(ArrayRef<ArrayRef<uint8_t>> Records);
24 
25   std::optional<TypeIndex> getFirst() override;
26   std::optional<TypeIndex> getNext(TypeIndex Prev) override;
27 
28   CVType getType(TypeIndex Index) override;
29   StringRef getTypeName(TypeIndex Index) override;
30   bool contains(TypeIndex Index) override;
31   uint32_t size() override;
32   uint32_t capacity() override;
33   bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) override;
34 
35 private:
36   BumpPtrAllocator Allocator;
37   StringSaver NameStorage;
38   std::vector<StringRef> Names;
39   ArrayRef<ArrayRef<uint8_t>> Records;
40 };
41 }
42 }
43 
44 #endif
45