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