xref: /freebsd/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===- CVTypeVisitor.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_CVTYPEVISITOR_H
10 #define LLVM_DEBUGINFO_CODEVIEW_CVTYPEVISITOR_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/DebugInfo/CodeView/CVRecord.h"
14 #include "llvm/DebugInfo/CodeView/CodeView.h"
15 #include "llvm/Support/Compiler.h"
16 #include "llvm/Support/Error.h"
17 
18 namespace llvm {
19 namespace codeview {
20 class TypeIndex;
21 class TypeCollection;
22 class TypeVisitorCallbacks;
23 struct CVMemberRecord;
24 
25 enum VisitorDataSource {
26   VDS_BytesPresent, // The record bytes are passed into the visitation
27                     // function.  The algorithm should first deserialize them
28                     // before passing them on through the pipeline.
29   VDS_BytesExternal // The record bytes are not present, and it is the
30                     // responsibility of the visitor callback interface to
31                     // supply the bytes.
32 };
33 
34 LLVM_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
35                                TypeVisitorCallbacks &Callbacks,
36                                VisitorDataSource Source = VDS_BytesPresent);
37 LLVM_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
38                                VisitorDataSource Source = VDS_BytesPresent);
39 
40 LLVM_ABI Error visitMemberRecord(CVMemberRecord Record,
41                                  TypeVisitorCallbacks &Callbacks,
42                                  VisitorDataSource Source = VDS_BytesPresent);
43 LLVM_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
44                                  TypeVisitorCallbacks &Callbacks);
45 
46 LLVM_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
47                                        TypeVisitorCallbacks &Callbacks);
48 
49 LLVM_ABI Error visitTypeStream(const CVTypeArray &Types,
50                                TypeVisitorCallbacks &Callbacks,
51                                VisitorDataSource Source = VDS_BytesPresent);
52 LLVM_ABI Error visitTypeStream(CVTypeRange Types,
53                                TypeVisitorCallbacks &Callbacks);
54 LLVM_ABI Error visitTypeStream(TypeCollection &Types,
55                                TypeVisitorCallbacks &Callbacks);
56 
57 } // end namespace codeview
58 } // end namespace llvm
59 
60 #endif // LLVM_DEBUGINFO_CODEVIEW_CVTYPEVISITOR_H
61