LLVM 20.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
16#include "llvm/TextAPI/Record.h"
18
19namespace llvm {
20namespace MachO {
21
22/// Base class for any usage of traversing over collected Records.
24public:
25 virtual ~RecordVisitor();
26
27 virtual void visitGlobal(const GlobalRecord &) = 0;
28 virtual void visitObjCInterface(const ObjCInterfaceRecord &);
29 virtual void visitObjCCategory(const ObjCCategoryRecord &);
30};
31
32/// Specialized RecordVisitor for collecting exported symbols
33/// and undefined symbols if RecordSlice being visited represents a
34/// flat-namespaced library.
36public:
38 const bool RecordUndefs = false)
39 : Symbols(Symbols), Targ(T), RecordUndefs(RecordUndefs) {}
40 void visitGlobal(const GlobalRecord &) override;
41 void visitObjCInterface(const ObjCInterfaceRecord &) override;
42 void visitObjCCategory(const ObjCCategoryRecord &) override;
43
44private:
45 void addIVars(const ArrayRef<ObjCIVarRecord *>, StringRef ContainerName);
46 SymbolSet *Symbols;
47 const Target Targ;
48 const bool RecordUndefs;
49};
50
51} // end namespace MachO.
52} // end namespace llvm.
53
54#endif // LLVM_TEXTAPI_RECORDVISITOR_H
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.
Definition: RecordVisitor.h:23
virtual void visitGlobal(const GlobalRecord &)=0
virtual void visitObjCCategory(const ObjCCategoryRecord &)
virtual void visitObjCInterface(const ObjCInterfaceRecord &)
Specialized RecordVisitor for collecting exported symbols and undefined symbols if RecordSlice being ...
Definition: RecordVisitor.h:35
void visitObjCInterface(const ObjCInterfaceRecord &) override
void visitObjCCategory(const ObjCCategoryRecord &) override
void visitGlobal(const GlobalRecord &) override
SymbolConverter(SymbolSet *Symbols, const Target &T, const bool RecordUndefs=false)
Definition: RecordVisitor.h:37
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18