LLVM  4.0.0
TypeVisitorCallbacks.h
Go to the documentation of this file.
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 
14 #include "llvm/Support/Error.h"
15 
16 namespace llvm {
17 namespace codeview {
18 
20  friend class CVTypeVisitor;
21 
22 public:
23  virtual ~TypeVisitorCallbacks() = default;
24 
25  /// Action to take on unknown types. By default, they are ignored.
27  /// Paired begin/end actions for all types. Receives all record data,
28  /// including the fixed-length record prefix. visitTypeBegin() should return
29  /// the type of the Record, or an error if it cannot be determined.
31  virtual Error visitTypeEnd(CVType &Record) { return Error::success(); }
32 
34  return Error::success();
35  }
36 
38  return Error::success();
39  }
40 
42  return Error::success();
43  }
44 
45 #define TYPE_RECORD(EnumName, EnumVal, Name) \
46  virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) { \
47  return Error::success(); \
48  }
49 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
50  virtual Error visitKnownMember(CVMemberRecord &CVM, Name##Record &Record) { \
51  return Error::success(); \
52  }
53 
54 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
55 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
56 #include "TypeRecords.def"
57 };
58 
59 } // end namespace codeview
60 } // end namespace llvm
61 
62 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
virtual Error visitUnknownMember(CVMemberRecord &Record)
virtual Error visitUnknownType(CVType &Record)
Action to take on unknown types. By default, they are ignored.
virtual Error visitTypeEnd(CVType &Record)
static ErrorSuccess success()
Create a success value.
virtual Error visitMemberBegin(CVMemberRecord &Record)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
Lightweight error class with error context and mandatory checking.
virtual Error visitMemberEnd(CVMemberRecord &Record)