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