1 //===- TypeIndexDiscovery.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_TYPEINDEXDISCOVERY_H 11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEINDEXDISCOVERY_H 12 13 #include "llvm/ADT/SmallVector.h" 14 #include "llvm/DebugInfo/CodeView/SymbolRecord.h" 15 #include "llvm/DebugInfo/CodeView/TypeRecord.h" 16 #include "llvm/Support/Error.h" 17 18 namespace llvm { 19 namespace codeview { 20 enum class TiRefKind { TypeRef, IndexRef }; 21 struct TiReference { 22 TiRefKind Kind; 23 uint32_t Offset; 24 uint32_t Count; 25 }; 26 27 void discoverTypeIndices(ArrayRef<uint8_t> RecordData, 28 SmallVectorImpl<TiReference> &Refs); 29 void discoverTypeIndices(const CVType &Type, 30 SmallVectorImpl<TiReference> &Refs); 31 void discoverTypeIndices(const CVType &Type, 32 SmallVectorImpl<TypeIndex> &Indices); 33 void discoverTypeIndices(ArrayRef<uint8_t> RecordData, 34 SmallVectorImpl<TypeIndex> &Indices); 35 36 /// Discover type indices in symbol records. Returns false if this is an unknown 37 /// record. 38 bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol, 39 SmallVectorImpl<TiReference> &Refs); 40 bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData, 41 SmallVectorImpl<TiReference> &Refs); 42 bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData, 43 SmallVectorImpl<TypeIndex> &Indices); 44 } 45 } 46 47 #endif 48