Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:40

0001 //===- TypeVisitorCallbacks.h -----------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
0011 
0012 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
0013 #include "llvm/Support/Error.h"
0014 
0015 namespace llvm {
0016 namespace codeview {
0017 
0018 class TypeVisitorCallbacks {
0019 public:
0020   virtual ~TypeVisitorCallbacks() = default;
0021 
0022   /// Action to take on unknown types. By default, they are ignored.
0023   virtual Error visitUnknownType(CVType &Record) { return Error::success(); }
0024   /// Paired begin/end actions for all types. Receives all record data,
0025   /// including the fixed-length record prefix.  visitTypeBegin() should return
0026   /// the type of the Record, or an error if it cannot be determined.  Exactly
0027   /// one of the two visitTypeBegin methods will be called, depending on whether
0028   /// records are being visited sequentially or randomly.  An implementation
0029   /// should be prepared to handle both (or assert if it can't handle random
0030   /// access visitation).
0031   virtual Error visitTypeBegin(CVType &Record) { return Error::success(); }
0032   virtual Error visitTypeBegin(CVType &Record, TypeIndex Index) {
0033     return Error::success();
0034   }
0035   virtual Error visitTypeEnd(CVType &Record) { return Error::success(); }
0036 
0037   virtual Error visitUnknownMember(CVMemberRecord &Record) {
0038     return Error::success();
0039   }
0040 
0041   virtual Error visitMemberBegin(CVMemberRecord &Record) {
0042     return Error::success();
0043   }
0044 
0045   virtual Error visitMemberEnd(CVMemberRecord &Record) {
0046     return Error::success();
0047   }
0048 
0049 #define TYPE_RECORD(EnumName, EnumVal, Name)                                   \
0050   virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) {          \
0051     return Error::success();                                                   \
0052   }
0053 #define MEMBER_RECORD(EnumName, EnumVal, Name)                                 \
0054   virtual Error visitKnownMember(CVMemberRecord &CVM, Name##Record &Record) {  \
0055     return Error::success();                                                   \
0056   }
0057 
0058 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
0059 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
0060 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
0061 #undef TYPE_RECORD
0062 #undef TYPE_RECORD_ALIAS
0063 #undef MEMBER_RECORD
0064 #undef MEMBER_RECORD_ALIAS
0065 };
0066 
0067 } // end namespace codeview
0068 } // end namespace llvm
0069 
0070 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H