LLVM  14.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, 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. More...
 
NormalizedSectiongetSectionByIndex (unsigned Index)
 Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range. More...
 
Expected< NormalizedSection & > findSectionByIndex (unsigned Index)
 Try to get the section at the given index. More...
 
Expected< NormalizedSymbol & > findSymbolByIndex (uint64_t Index)
 Try to get the symbol at the given index. More...
 
SymbolgetSymbolByAddress (NormalizedSection &NSec, JITTargetAddress Address)
 Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists. More...
 
Expected< Symbol & > findSymbolByAddress (NormalizedSection &NSec, JITTargetAddress Address)
 Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists. More...
 
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 83 of file MachOLinkGraphBuilder.h.

Constructor & Destructor Documentation

◆ ~MachOLinkGraphBuilder()

llvm::jitlink::MachOLinkGraphBuilder::~MachOLinkGraphBuilder ( )
virtual

Definition at line 22 of file MachOLinkGraphBuilder.cpp.

◆ MachOLinkGraphBuilder()

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

Definition at line 48 of file MachOLinkGraphBuilder.cpp.

References string.

Member Function Documentation

◆ addCustomSectionParser()

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

◆ addRelocations()

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

◆ 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 99 of file MachOLinkGraphBuilder.h.

References Allocator, and llvm::AMDGPU::HSAMD::Kernel::Key::Args.

◆ 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 117 of file MachOLinkGraphBuilder.h.

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

◆ findSymbolByAddress()

Expected<Symbol &> llvm::jitlink::MachOLinkGraphBuilder::findSymbolByAddress ( NormalizedSection NSec,
JITTargetAddress  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 149 of file MachOLinkGraphBuilder.h.

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

◆ 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 128 of file MachOLinkGraphBuilder.h.

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

◆ getGraph()

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

Definition at line 88 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 90 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 108 of file MachOLinkGraphBuilder.h.

References assert(), I, and Index.

◆ getSymbolByAddress()

Symbol* llvm::jitlink::MachOLinkGraphBuilder::getSymbolByAddress ( NormalizedSection NSec,
JITTargetAddress  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 139 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: