1 //===- TypeIndexDiscovery.h -------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEINDEXDISCOVERY_H
10 #define LLVM_DEBUGINFO_CODEVIEW_TYPEINDEXDISCOVERY_H
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
14 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
15 #include "llvm/Support/Error.h"
19 enum class TiRefKind { TypeRef, IndexRef };
26 void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
27 SmallVectorImpl<TiReference> &Refs);
28 void discoverTypeIndices(const CVType &Type,
29 SmallVectorImpl<TiReference> &Refs);
30 void discoverTypeIndices(const CVType &Type,
31 SmallVectorImpl<TypeIndex> &Indices);
32 void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
33 SmallVectorImpl<TypeIndex> &Indices);
35 /// Discover type indices in symbol records. Returns false if this is an unknown
37 bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol,
38 SmallVectorImpl<TiReference> &Refs);
39 bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
40 SmallVectorImpl<TiReference> &Refs);
41 bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
42 SmallVectorImpl<TypeIndex> &Indices);