Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:37

0001 //===- llvm/TextAPI/RecordSlice.h - TAPI RecordSlice ------------*- 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 /// Defines the TAPI Record Visitor.
0010 ///
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_TEXTAPI_RECORDVISITOR_H
0014 #define LLVM_TEXTAPI_RECORDVISITOR_H
0015 
0016 #include "llvm/TextAPI/Record.h"
0017 #include "llvm/TextAPI/SymbolSet.h"
0018 
0019 namespace llvm {
0020 namespace MachO {
0021 
0022 /// Base class for any usage of traversing over collected Records.
0023 class RecordVisitor {
0024 public:
0025   virtual ~RecordVisitor();
0026 
0027   virtual void visitGlobal(const GlobalRecord &) = 0;
0028   virtual void visitObjCInterface(const ObjCInterfaceRecord &);
0029   virtual void visitObjCCategory(const ObjCCategoryRecord &);
0030 };
0031 
0032 /// Specialized RecordVisitor for collecting exported symbols
0033 /// and undefined symbols if RecordSlice being visited represents a
0034 /// flat-namespaced library.
0035 class SymbolConverter : public RecordVisitor {
0036 public:
0037   SymbolConverter(SymbolSet *Symbols, const Target &T,
0038                   const bool RecordUndefs = false)
0039       : Symbols(Symbols), Targ(T), RecordUndefs(RecordUndefs) {}
0040   void visitGlobal(const GlobalRecord &) override;
0041   void visitObjCInterface(const ObjCInterfaceRecord &) override;
0042   void visitObjCCategory(const ObjCCategoryRecord &) override;
0043 
0044 private:
0045   void addIVars(const ArrayRef<ObjCIVarRecord *>, StringRef ContainerName);
0046   SymbolSet *Symbols;
0047   const Target Targ;
0048   const bool RecordUndefs;
0049 };
0050 
0051 } // end namespace MachO.
0052 } // end namespace llvm.
0053 
0054 #endif // LLVM_TEXTAPI_RECORDVISITOR_H