LLVM 19.0.0git
Classes | Public Member Functions | List of all members
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.
 
RecordaddRecord (StringRef Name, SymbolFlags Flags, GlobalRecord::Kind GV=GlobalRecord::Kind::Unknown, RecordLinkage Linkage=RecordLinkage::Unknown)
 Add unspecified record to slice.
 
GlobalRecordaddGlobal (StringRef Name, RecordLinkage Linkage, GlobalRecord::Kind GV, SymbolFlags Flags=SymbolFlags::None, bool Inlined=false)
 Add non-ObjC global record.
 
ObjCInterfaceRecordaddObjCInterface (StringRef Name, RecordLinkage Linkage, ObjCIFSymbolKind SymType)
 Add ObjC Class record.
 
ObjCIVarRecordaddObjCIVar (ObjCContainerRecord *Container, StringRef Name, RecordLinkage Linkage)
 Add ObjC IVar record.
 
ObjCCategoryRecordaddObjCCategory (StringRef ClassToExtend, StringRef Category)
 Add ObjC Category record.
 
ObjCInterfaceRecordfindObjCInterface (StringRef Name) const
 Find ObjC Class.
 
ObjCCategoryRecordfindObjCCategory (StringRef ClassToExtend, StringRef Category) const
 Find ObjC Category.
 
ObjCContainerRecordfindContainer (bool IsIVar, StringRef Name) const
 Find ObjC Container.
 
ObjCIVarRecordfindObjCIVar (bool IsScopedName, StringRef Name) const
 Find ObjC instance variable.
 
GlobalRecordfindGlobal (StringRef Name, GlobalRecord::Kind GV=GlobalRecord::Kind::Unknown) const
 Find non-objc global.
 
bool hasBinaryAttrs () const
 
bool empty () const
 
void visit (RecordVisitor &V) const
 
BinaryAttrsgetBinaryAttrs ()
 Return reference to BinaryAttrs.
 
StringRef copyString (StringRef String)
 Store any strings owned by RecordSlice into allocator and return back reference to that.
 

Detailed Description

Definition at line 28 of file RecordsSlice.h.

Constructor & Destructor Documentation

◆ RecordsSlice()

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

Definition at line 30 of file RecordsSlice.h.

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, Name, 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(), and Name.

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 267 of file RecordsSlice.cpp.

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

Referenced by addRecord().

◆ addRecord()

Record * RecordsSlice::addRecord ( StringRef  Name,
SymbolFlags  Flags,
GlobalRecord::Kind  GV = GlobalRecord::Kind::Unknown,
RecordLinkage  Linkage = RecordLinkage::Unknown 
)

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, Name, llvm::MachO::ObjectiveCClass, llvm::MachO::ObjectiveCClassEHType, llvm::MachO::ObjectiveCInstanceVariable, llvm::MachO::parseSymbol(), and llvm::MachO::WeakDefined.

◆ copyString()

StringRef RecordsSlice::copyString ( StringRef  String)

◆ empty()

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

Definition at line 135 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(), findObjCInterface(), and Name.

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 llvm::MachO::GlobalRecord::Function, Name, 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.

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 Name.

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 _, findContainer(), and Name.

◆ getBinaryAttrs()

RecordsSlice::BinaryAttrs & RecordsSlice::getBinaryAttrs ( )

Return reference to BinaryAttrs.

Definition at line 288 of file RecordsSlice.cpp.

References hasBinaryAttrs().

◆ getTarget()

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

Get TAPI converted target.

Definition at line 34 of file RecordsSlice.h.

◆ getTriple()

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

Get target triple.

Definition at line 32 of file RecordsSlice.h.

◆ hasBinaryAttrs()

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

Definition at line 132 of file RecordsSlice.h.

Referenced by empty(), and getBinaryAttrs().

◆ visit()

void RecordsSlice::visit ( RecordVisitor V) const

Definition at line 294 of file RecordsSlice.cpp.

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


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