LLVM 22.0.0git
llvm::MachO::RecordsSlice Class Reference

#include "llvm/TextAPI/RecordsSlice.h"

Classes

struct  BinaryAttrs

Public Member Functions

 RecordsSlice (const llvm::Triple &T)
const llvm::TriplegetTriple () const
 Get target triple.
const TargetgetTarget () const
 Get TAPI converted target.
LLVM_ABI RecordaddRecord (StringRef Name, SymbolFlags Flags, GlobalRecord::Kind GV=GlobalRecord::Kind::Unknown, RecordLinkage Linkage=RecordLinkage::Unknown)
 Add unspecified record to slice.
LLVM_ABI GlobalRecordaddGlobal (StringRef Name, RecordLinkage Linkage, GlobalRecord::Kind GV, SymbolFlags Flags=SymbolFlags::None, bool Inlined=false)
 Add non-ObjC global record.
LLVM_ABI ObjCInterfaceRecordaddObjCInterface (StringRef Name, RecordLinkage Linkage, ObjCIFSymbolKind SymType)
 Add ObjC Class record.
LLVM_ABI ObjCIVarRecordaddObjCIVar (ObjCContainerRecord *Container, StringRef Name, RecordLinkage Linkage)
 Add ObjC IVar record.
LLVM_ABI ObjCCategoryRecordaddObjCCategory (StringRef ClassToExtend, StringRef Category)
 Add ObjC Category record.
LLVM_ABI ObjCInterfaceRecordfindObjCInterface (StringRef Name) const
 Find ObjC Class.
LLVM_ABI ObjCCategoryRecordfindObjCCategory (StringRef ClassToExtend, StringRef Category) const
 Find ObjC Category.
LLVM_ABI ObjCContainerRecordfindContainer (bool IsIVar, StringRef Name) const
 Find ObjC Container.
LLVM_ABI ObjCIVarRecordfindObjCIVar (bool IsScopedName, StringRef Name) const
 Find ObjC instance variable.
LLVM_ABI GlobalRecordfindGlobal (StringRef Name, GlobalRecord::Kind GV=GlobalRecord::Kind::Unknown) const
 Find non-objc global.
bool hasBinaryAttrs () const
bool empty () const
LLVM_ABI void visit (RecordVisitor &V) const
LLVM_ABI BinaryAttrsgetBinaryAttrs ()
 Return reference to BinaryAttrs.
LLVM_ABI StringRef copyString (StringRef String)
 Store any strings owned by RecordSlice into allocator and return back reference to that.

Detailed Description

Definition at line 29 of file RecordsSlice.h.

Constructor & Destructor Documentation

◆ RecordsSlice()

llvm::MachO::RecordsSlice::RecordsSlice ( const llvm::Triple & T)
inline

Definition at line 31 of file RecordsSlice.h.

References T.

Member Function Documentation

◆ addGlobal()

GlobalRecord * RecordsSlice::addGlobal ( StringRef Name,
RecordLinkage Linkage,
GlobalRecord::Kind GV,
SymbolFlags Flags = SymbolFlags::None,
bool Inlined = false )

Add non-ObjC global record.

Parameters
NameThe name of symbol.
LinkageThe linkage of symbol.
GVThe kind of global.
FlagsThe flags that describe attributes of the symbol.
InlinedWhether declaration is inlined, only applicable to functions.
Returns
The non-owning pointer to added record in slice.

Definition at line 173 of file RecordsSlice.cpp.

References copyString(), llvm::MachO::Data, llvm::MachO::GlobalRecord::Function, llvm::MachO::Text, and llvm::MachO::GlobalRecord::Variable.

Referenced by addRecord().

◆ addObjCCategory()

ObjCCategoryRecord * RecordsSlice::addObjCCategory ( StringRef ClassToExtend,
StringRef Category )

Add ObjC Category record.

Parameters
ClassToExtendThe name of class that is being extended by the category, not symbol.
CategoryThe name of category.
Returns
The non-owning pointer to added record in slice.

Definition at line 225 of file RecordsSlice.cpp.

References copyString(), and findObjCInterface().

Referenced by addRecord().

◆ addObjCInterface()

ObjCInterfaceRecord * RecordsSlice::addObjCInterface ( StringRef Name,
RecordLinkage Linkage,
ObjCIFSymbolKind SymType )

Add ObjC Class record.

Parameters
NameThe name of class, not symbol.
LinkageThe linkage of symbol.
SymTypeThe symbols this class represents.
Returns
The non-owning pointer to added record in slice.

Definition at line 193 of file RecordsSlice.cpp.

References copyString().

Referenced by addRecord().

◆ addObjCIVar()

ObjCIVarRecord * RecordsSlice::addObjCIVar ( ObjCContainerRecord * Container,
StringRef Name,
RecordLinkage Linkage )

Add ObjC IVar record.

Parameters
ContainerOwning pointer for instance variable.
NameThe name of ivar, not symbol.
LinkageThe linkage of symbol.
Returns
The non-owning pointer to added record in slice.

Definition at line 268 of file RecordsSlice.cpp.

References llvm::MachO::ObjCContainerRecord::addObjCIVar(), and copyString().

Referenced by addRecord().

◆ addRecord()

Add unspecified record to slice.

Assign specific record type based on properties and symbol name.

Parameters
NameThe name of symbol.
FlagsThe flags that describe attributes of the symbol.
GVThe kind of global, if this represents a non obj-c global symbol.
LinkageThe linkage of symbol.
Returns
The non-owning pointer to added record in slice.

Definition at line 23 of file RecordsSlice.cpp.

References addGlobal(), addObjCCategory(), addObjCInterface(), addObjCIVar(), findContainer(), llvm::MachO::GlobalSymbol, llvm_unreachable, llvm::MachO::ObjectiveCClass, llvm::MachO::ObjectiveCClassEHType, llvm::MachO::ObjectiveCInstanceVariable, llvm::MachO::parseSymbol(), and llvm::MachO::WeakDefined.

◆ copyString()

StringRef RecordsSlice::copyString ( StringRef String)

Store any strings owned by RecordSlice into allocator and return back reference to that.

Definition at line 277 of file RecordsSlice.cpp.

References Ptr, and llvm::String.

Referenced by addGlobal(), addObjCCategory(), addObjCInterface(), and addObjCIVar().

◆ empty()

bool llvm::MachO::RecordsSlice::empty ( ) const
inline

Definition at line 140 of file RecordsSlice.h.

References hasBinaryAttrs().

◆ findContainer()

ObjCContainerRecord * RecordsSlice::findContainer ( bool IsIVar,
StringRef Name ) const

Find ObjC Container.

This is commonly used for assigning for looking up instance variables that are assigned to either a category or class.

Parameters
IsIVarIf true, the name is the name of the IVar, otherwise it will be looked up as the name of the container.
NameEither the name of ivar or name of container.
Returns
The non-owning pointer to record in slice.

Definition at line 55 of file RecordsSlice.cpp.

References findObjCCategory(), and findObjCInterface().

Referenced by addRecord(), and findObjCIVar().

◆ findGlobal()

GlobalRecord * RecordsSlice::findGlobal ( StringRef Name,
GlobalRecord::Kind GV = GlobalRecord::Kind::Unknown ) const

Find non-objc global.

Parameters
NameThe name of symbol.
GVThe Kind of global to find.
Returns
The non-owning pointer to record in slice.

Definition at line 74 of file RecordsSlice.cpp.

References findRecord(), llvm::MachO::GlobalRecord::Function, llvm::MachO::GlobalRecord::Unknown, and llvm::MachO::GlobalRecord::Variable.

◆ findObjCCategory()

ObjCCategoryRecord * RecordsSlice::findObjCCategory ( StringRef ClassToExtend,
StringRef Category ) const

Find ObjC Category.

Parameters
ClassToExtendThe name of class, not full symbol name.
CategoryThe name of category.
Returns
The non-owning pointer to record in slice.

Definition at line 135 of file RecordsSlice.cpp.

References findRecord().

Referenced by findContainer().

◆ findObjCInterface()

ObjCInterfaceRecord * RecordsSlice::findObjCInterface ( StringRef Name) const

Find ObjC Class.

Parameters
Namename of class, not full symbol name.
Returns
The non-owning pointer to record in slice.

Definition at line 131 of file RecordsSlice.cpp.

References findRecord().

Referenced by addObjCCategory(), and findContainer().

◆ findObjCIVar()

ObjCIVarRecord * RecordsSlice::findObjCIVar ( bool IsScopedName,
StringRef Name ) const

Find ObjC instance variable.

Parameters
IsScopedNameThis is used to determine how to parse the name.
NameEither the full name of the symbol or just the ivar.
Returns
The non-owning pointer to record in slice.

Definition at line 145 of file RecordsSlice.cpp.

References _, and findContainer().

◆ getBinaryAttrs()

RecordsSlice::BinaryAttrs & RecordsSlice::getBinaryAttrs ( )

Return reference to BinaryAttrs.

Definition at line 289 of file RecordsSlice.cpp.

References hasBinaryAttrs().

◆ getTarget()

const Target & llvm::MachO::RecordsSlice::getTarget ( ) const
inline

Get TAPI converted target.

Definition at line 35 of file RecordsSlice.h.

◆ getTriple()

const llvm::Triple & llvm::MachO::RecordsSlice::getTriple ( ) const
inline

Get target triple.

Definition at line 33 of file RecordsSlice.h.

◆ hasBinaryAttrs()

bool llvm::MachO::RecordsSlice::hasBinaryAttrs ( ) const
inline

Definition at line 137 of file RecordsSlice.h.

Referenced by empty(), and getBinaryAttrs().

◆ visit()

void RecordsSlice::visit ( RecordVisitor & V) const

Definition at line 295 of file RecordsSlice.cpp.

References llvm::CallingConv::C, and G.


The documentation for this class was generated from the following files: