LLVM 22.0.0git
RecordVisitor.h
Go to the documentation of this file.
1//===- llvm/TextAPI/RecordSlice.h - TAPI RecordSlice ------------*- 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/// Defines the TAPI Record Visitor.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TEXTAPI_RECORDVISITOR_H
14#define LLVM_TEXTAPI_RECORDVISITOR_H
15
17#include "llvm/TextAPI/Record.h"
19
20namespace llvm {
21namespace MachO {
22
23/// Base class for any usage of traversing over collected Records.
25public:
26 virtual ~RecordVisitor();
27
28 virtual void visitGlobal(const GlobalRecord &) = 0;
29 virtual void visitObjCInterface(const ObjCInterfaceRecord &);
30 virtual void visitObjCCategory(const ObjCCategoryRecord &);
31};
32
33/// Specialized RecordVisitor for collecting exported symbols
34/// and undefined symbols if RecordSlice being visited represents a
35/// flat-namespaced library.
37public:
39 const bool RecordUndefs = false)
40 : Symbols(Symbols), Targ(T), RecordUndefs(RecordUndefs) {}
41 void visitGlobal(const GlobalRecord &) override;
42 void visitObjCInterface(const ObjCInterfaceRecord &) override;
43 void visitObjCCategory(const ObjCCategoryRecord &) override;
44
45private:
46 void addIVars(const ArrayRef<ObjCIVarRecord *>, StringRef ContainerName);
47 SymbolSet *Symbols;
48 const Target Targ;
49 const bool RecordUndefs;
50};
51
52} // end namespace MachO.
53} // end namespace llvm.
54
55#endif // LLVM_TEXTAPI_RECORDVISITOR_H
#define LLVM_ABI
Definition Compiler.h:213
#define T
Implements the TAPI Record Types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
Base class for any usage of traversing over collected Records.
virtual void visitGlobal(const GlobalRecord &)=0
virtual void visitObjCCategory(const ObjCCategoryRecord &)
virtual void visitObjCInterface(const ObjCInterfaceRecord &)
SymbolConverter(SymbolSet *Symbols, const Target &T, const bool RecordUndefs=false)
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
This is an optimization pass for GlobalISel generic memory operations.