1 //===- TypeTableCollection.h ---------------------------------- *- C++ --*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPETABLECOLLECTION_H 11 #define LLVM_DEBUGINFO_CODEVIEW_TYPETABLECOLLECTION_H 12 13 #include "llvm/DebugInfo/CodeView/TypeCollection.h" 14 #include "llvm/DebugInfo/CodeView/TypeDatabase.h" 15 16 namespace llvm { 17 namespace codeview { 18 19 class TypeTableCollection : public TypeCollection { 20 public: 21 explicit TypeTableCollection(ArrayRef<ArrayRef<uint8_t>> Records); 22 23 Optional<TypeIndex> getFirst() override; 24 Optional<TypeIndex> getNext(TypeIndex Prev) override; 25 26 CVType getType(TypeIndex Index) override; 27 StringRef getTypeName(TypeIndex Index) override; 28 bool contains(TypeIndex Index) override; 29 uint32_t size() override; 30 uint32_t capacity() override; 31 32 private: 33 bool hasCapacityFor(TypeIndex Index) const; 34 void ensureTypeExists(TypeIndex Index); 35 36 ArrayRef<ArrayRef<uint8_t>> Records; 37 TypeDatabase Database; 38 }; 39 } 40 } 41 42 #endif 43