]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
Merge ^/head r308491 through r308841.
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / TypeVisitorCallbacks.h
1 //===- TypeVisitorCallbacks.h -----------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
12
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/DebugInfo/CodeView/CodeView.h"
15 #include "llvm/DebugInfo/CodeView/CVRecord.h"
16 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
17 #include "llvm/Support/Error.h"
18
19 namespace llvm {
20 namespace codeview {
21 class TypeVisitorCallbacks {
22   friend class CVTypeVisitor;
23
24 public:
25   virtual ~TypeVisitorCallbacks() {}
26
27   /// Action to take on unknown types. By default, they are ignored.
28   virtual Error visitUnknownType(const CVRecord<TypeLeafKind> &Record) {
29     return Error::success();
30   }
31   virtual Error visitUnknownMember(const CVRecord<TypeLeafKind> &Record) {
32     return Error::success();
33   }
34
35   /// Paired begin/end actions for all types. Receives all record data,
36   /// including the fixed-length record prefix.
37   virtual Error visitTypeBegin(const CVRecord<TypeLeafKind> &Record) {
38     return Error::success();
39   }
40   virtual Error visitTypeEnd(const CVRecord<TypeLeafKind> &Record) {
41     return Error::success();
42   }
43
44   virtual Error visitFieldListBegin(const CVRecord<TypeLeafKind> &Record) {
45     return Error::success();
46   }
47
48   virtual Error visitFieldListEnd(const CVRecord<TypeLeafKind> &Record) {
49     return Error::success();
50   }
51
52 #define TYPE_RECORD(EnumName, EnumVal, Name)                                   \
53   virtual Error visit##Name(Name##Record &Record) { return Error::success(); }
54 #define MEMBER_RECORD(EnumName, EnumVal, Name)                                 \
55   TYPE_RECORD(EnumName, EnumVal, Name)
56 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
57 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
58 #include "TypeRecords.def"
59 };
60 }
61 }
62
63 #endif