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