LLVM 19.0.0git
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | List of all members
llvm::jitlink::MachOLinkGraphBuilder Class Referenceabstract

#include "ExecutionEngine/JITLink/MachOLinkGraphBuilder.h"

Classes

class  NormalizedSection
 
struct  NormalizedSymbol
 

Public Member Functions

virtual ~MachOLinkGraphBuilder ()
 
Expected< std::unique_ptr< LinkGraph > > buildGraph ()
 

Protected Types

using SectionParserFunction = std::function< Error(NormalizedSection &S)>
 

Protected Member Functions

 MachOLinkGraphBuilder (const object::MachOObjectFile &Obj, Triple TT, SubtargetFeatures Features, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
 
LinkGraphgetGraph () const
 
const object::MachOObjectFilegetObject () const
 
void addCustomSectionParser (StringRef SectionName, SectionParserFunction Parse)
 
virtual Error addRelocations ()=0
 
template<typename... ArgTs>
NormalizedSymbolcreateNormalizedSymbol (ArgTs &&... Args)
 Create a symbol.
 
NormalizedSectiongetSectionByIndex (unsigned Index)
 Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range.
 
Expected< NormalizedSection & > findSectionByIndex (unsigned Index)
 Try to get the section at the given index.
 
Expected< NormalizedSymbol & > findSymbolByIndex (uint64_t Index)
 Try to get the symbol at the given index.
 
SymbolgetSymbolByAddress (NormalizedSection &NSec, orc::ExecutorAddr Address)
 Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists.
 
Expected< Symbol & > findSymbolByAddress (NormalizedSection &NSec, orc::ExecutorAddr Address)
 Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists.
 
MachO::relocation_info getRelocationInfo (const object::relocation_iterator RelItr)
 

Static Protected Member Functions

static Linkage getLinkage (uint16_t Desc)
 
static Scope getScope (StringRef Name, uint8_t Type)
 
static bool isAltEntry (const NormalizedSymbol &NSym)
 
static bool isDebugSection (const NormalizedSection &NSec)
 
static bool isZeroFillSection (const NormalizedSection &NSec)
 

Detailed Description

Definition at line 29 of file MachOLinkGraphBuilder.h.

Member Typedef Documentation

◆ SectionParserFunction

Definition at line 84 of file MachOLinkGraphBuilder.h.

Constructor & Destructor Documentation

◆ ~MachOLinkGraphBuilder()

llvm::jitlink::MachOLinkGraphBuilder::~MachOLinkGraphBuilder ( )
virtualdefault

◆ MachOLinkGraphBuilder()

llvm::jitlink::MachOLinkGraphBuilder::MachOLinkGraphBuilder ( const object::MachOObjectFile Obj,
Triple  TT,
SubtargetFeatures  Features,
LinkGraph::GetEdgeKindNameFunction  GetEdgeKindName 
)
protected

Member Function Documentation

◆ addCustomSectionParser()

void llvm::jitlink::MachOLinkGraphBuilder::addCustomSectionParser ( StringRef  SectionName,
SectionParserFunction  Parse 
)
protected

◆ addRelocations()

virtual Error llvm::jitlink::MachOLinkGraphBuilder::addRelocations ( )
protectedpure virtual

Referenced by buildGraph().

◆ buildGraph()

Expected< std::unique_ptr< LinkGraph > > llvm::jitlink::MachOLinkGraphBuilder::buildGraph ( )

◆ createNormalizedSymbol()

template<typename... ArgTs>
NormalizedSymbol & llvm::jitlink::MachOLinkGraphBuilder::createNormalizedSymbol ( ArgTs &&...  Args)
inlineprotected

Create a symbol.

Definition at line 101 of file MachOLinkGraphBuilder.h.

References Allocator, and Sym.

◆ findSectionByIndex()

Expected< NormalizedSection & > llvm::jitlink::MachOLinkGraphBuilder::findSectionByIndex ( unsigned  Index)
inlineprotected

Try to get the section at the given index.

Will return an error if the given index is out of range, or if no section has been added for the given index.

Definition at line 119 of file MachOLinkGraphBuilder.h.

References llvm::formatv(), and I.

◆ findSymbolByAddress()

Expected< Symbol & > llvm::jitlink::MachOLinkGraphBuilder::findSymbolByAddress ( NormalizedSection NSec,
orc::ExecutorAddr  Address 
)
inlineprotected

Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists.

Definition at line 151 of file MachOLinkGraphBuilder.h.

References llvm::Address, llvm::formatv(), getSymbolByAddress(), and Sym.

◆ findSymbolByIndex()

Expected< NormalizedSymbol & > llvm::jitlink::MachOLinkGraphBuilder::findSymbolByIndex ( uint64_t  Index)
inlineprotected

Try to get the symbol at the given index.

Will return an error if the given index is out of range, or if no symbol has been added for the given index.

Definition at line 130 of file MachOLinkGraphBuilder.h.

References assert(), llvm::formatv(), and I.

◆ getGraph()

LinkGraph & llvm::jitlink::MachOLinkGraphBuilder::getGraph ( ) const
inlineprotected

Definition at line 90 of file MachOLinkGraphBuilder.h.

References G.

◆ getLinkage()

Linkage llvm::jitlink::MachOLinkGraphBuilder::getLinkage ( uint16_t  Desc)
staticprotected

◆ getObject()

const object::MachOObjectFile & llvm::jitlink::MachOLinkGraphBuilder::getObject ( ) const
inlineprotected

Definition at line 92 of file MachOLinkGraphBuilder.h.

Referenced by getRelocationInfo().

◆ getRelocationInfo()

MachO::relocation_info llvm::jitlink::MachOLinkGraphBuilder::getRelocationInfo ( const object::relocation_iterator  RelItr)
inlineprotected

◆ getScope()

Scope llvm::jitlink::MachOLinkGraphBuilder::getScope ( StringRef  Name,
uint8_t  Type 
)
staticprotected

◆ getSectionByIndex()

NormalizedSection & llvm::jitlink::MachOLinkGraphBuilder::getSectionByIndex ( unsigned  Index)
inlineprotected

Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range.

Client is responsible for checking.

Definition at line 110 of file MachOLinkGraphBuilder.h.

References assert(), and I.

◆ getSymbolByAddress()

Symbol * llvm::jitlink::MachOLinkGraphBuilder::getSymbolByAddress ( NormalizedSection NSec,
orc::ExecutorAddr  Address 
)
inlineprotected

Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists.

Definition at line 141 of file MachOLinkGraphBuilder.h.

References llvm::Address, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::CanonicalSymbols, and I.

Referenced by findSymbolByAddress().

◆ isAltEntry()

bool llvm::jitlink::MachOLinkGraphBuilder::isAltEntry ( const NormalizedSymbol NSym)
staticprotected

◆ isDebugSection()

bool llvm::jitlink::MachOLinkGraphBuilder::isDebugSection ( const NormalizedSection NSec)
staticprotected

◆ isZeroFillSection()

bool llvm::jitlink::MachOLinkGraphBuilder::isZeroFillSection ( const NormalizedSection NSec)
staticprotected

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