class MachOLinkGraphBuilder

Declaration

class MachOLinkGraphBuilder { /* full declaration omitted */ };

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:29

Member Variables

private llvm::BumpPtrAllocator Allocator
private const object::MachOObjectFile& Obj
private std::unique_ptr<LinkGraph> G
private DenseMap<unsigned int, llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection> IndexToSection
private llvm::jitlink::Section* CommonSection = nullptr
private DenseMap<uint32_t, llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSymbol*> IndexToSymbol
private StringMap<llvm::jitlink::MachOLinkGraphBuilder:: SectionParserFunction> CustomSectionParserFunctions

Method Overview

  • protected MachOLinkGraphBuilder(const object::MachOObjectFile & Obj, llvm::Triple TT, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
  • protected void addCustomSectionParser(llvm::StringRef SectionName, llvm::jitlink::MachOLinkGraphBuilder::SectionParserFunction Parse)
  • protected virtual llvm::Error addRelocations()
  • private void addSectionStartSymAndBlock(unsigned int SecIndex, llvm::jitlink::Section & GraphSec, orc::ExecutorAddr Address, const char * Data, orc::ExecutorAddrDiff Size, uint32_t Alignment, bool IsLive)
  • public Expected<std::unique_ptr<LinkGraph>> buildGraph()
  • private llvm::Error createNormalizedSections()
  • protected template <typename... ArgTs>llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol & createNormalizedSymbol(ArgTs &&... Args)
  • private llvm::Error createNormalizedSymbols()
  • private llvm::jitlink::Symbol & createStandardGraphSymbol(llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol & Sym, llvm::jitlink::Block & B, size_t Size, bool IsText, bool IsNoDeadStrip, bool IsCanonical)
  • protected Expected<llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection &> findSectionByIndex(unsigned int Index)
  • protected Expected<llvm::jitlink::Symbol &> findSymbolByAddress(llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec, orc::ExecutorAddr Address)
  • protected Expected<llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol &> findSymbolByIndex(uint64_t Index)
  • private llvm::jitlink::Section & getCommonSection()
  • private static support::endianness getEndianness(const object::MachOObjectFile & Obj)
  • protected llvm::jitlink::LinkGraph & getGraph() const
  • protected static llvm::jitlink::Linkage getLinkage(uint16_t Desc)
  • protected const object::MachOObjectFile & getObject() const
  • private static unsigned int getPointerSize(const object::MachOObjectFile & Obj)
  • protected MachO::relocation_info getRelocationInfo(const object::relocation_iterator RelItr)
  • protected static llvm::jitlink::Scope getScope(llvm::StringRef Name, uint8_t Type)
  • protected llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & getSectionByIndex(unsigned int Index)
  • protected llvm::jitlink::Symbol * getSymbolByAddress(llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec, orc::ExecutorAddr Address)
  • private llvm::Error graphifyCStringSection(llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec, std::vector<NormalizedSymbol *> NSyms)
  • private llvm::Error graphifyRegularSymbols()
  • private llvm::Error graphifySectionsWithCustomParsers()
  • protected static bool isAltEntry(const llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol & NSym)
  • protected static bool isDebugSection(const llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec)
  • protected static bool isZeroFillSection(const llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec)
  • private void setCanonicalSymbol(llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection & NSec, llvm::jitlink::Symbol & Sym)
  • public virtual ~MachOLinkGraphBuilder()

Methods

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:85

Parameters

const object::MachOObjectFile& Obj
llvm::Triple TT
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:92

Parameters

llvm::StringRef SectionName
llvm::jitlink::MachOLinkGraphBuilder:: SectionParserFunction Parse

virtual llvm::Error addRelocations()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:95

void addSectionStartSymAndBlock(
    unsigned int SecIndex,
    llvm::jitlink::Section& GraphSec,
    orc::ExecutorAddr Address,
    const char* Data,
    orc::ExecutorAddrDiff Size,
    uint32_t Alignment,
    bool IsLive)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:195

Parameters

unsigned int SecIndex
llvm::jitlink::Section& GraphSec
orc::ExecutorAddr Address
const char* Data
orc::ExecutorAddrDiff Size
uint32_t Alignment
bool IsLive

Expected<std::unique_ptr<LinkGraph>> buildGraph()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:32

llvm::Error createNormalizedSections()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:200

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

Description

Create a symbol.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:99

Templates

ArgTs

Parameters

ArgTs&&... Args

llvm::Error createNormalizedSymbols()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:201

llvm::jitlink::Symbol& createStandardGraphSymbol(
    llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSymbol& Sym,
    llvm::jitlink::Block& B,
    size_t Size,
    bool IsText,
    bool IsNoDeadStrip,
    bool IsCanonical)

Description

Create and return a graph symbol for the given normalized symbol. NSym's GraphSymbol member will be updated to point at the newly created symbol.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:211

Parameters

llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSymbol& Sym
llvm::jitlink::Block& B
size_t Size
bool IsText
bool IsNoDeadStrip
bool IsCanonical

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

Description

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.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:117

Parameters

unsigned int Index

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

Description

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:149

Parameters

llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec
orc::ExecutorAddr Address

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

Description

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.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:128

Parameters

uint64_t Index

llvm::jitlink::Section& getCommonSection()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:194

static support::endianness getEndianness(
    const object::MachOObjectFile& Obj)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:182

Parameters

const object::MachOObjectFile& Obj

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:88

static llvm::jitlink::Linkage getLinkage(
    uint16_t Desc)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:159

Parameters

uint16_t Desc

const object::MachOObjectFile& getObject() const

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:90

static unsigned int getPointerSize(
    const object::MachOObjectFile& Obj)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:181

Parameters

const object::MachOObjectFile& Obj

MachO::relocation_info getRelocationInfo(
    const object::relocation_iterator RelItr)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:167

Parameters

const object::relocation_iterator RelItr

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:160

Parameters

llvm::StringRef Name
uint8_t Type

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

Description

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:108

Parameters

unsigned int Index

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

Description

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

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:139

Parameters

llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec
orc::ExecutorAddr Address

llvm::Error graphifyCStringSection(
    llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSection& NSec,
    std::vector<NormalizedSymbol*> NSyms)

Description

Graphify cstring section.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:219

Parameters

llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec
std::vector<NormalizedSymbol*> NSyms

llvm::Error graphifyRegularSymbols()

Description

Create graph blocks and symbols for externals, absolutes, commons and all defined symbols in sections without custom parsers.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:205

llvm::Error graphifySectionsWithCustomParsers()

Description

Create graph blocks and symbols for all sections.

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:216

static bool isAltEntry(
    const llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSymbol& NSym)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:161

Parameters

const llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSymbol& NSym

static bool isDebugSection(
    const llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSection& NSec)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:163

Parameters

const llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec

static bool isZeroFillSection(
    const llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSection& NSec)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:164

Parameters

const llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec

void setCanonicalSymbol(
    llvm::jitlink::MachOLinkGraphBuilder::
        NormalizedSection& NSec,
    llvm::jitlink::Symbol& Sym)

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:184

Parameters

llvm::jitlink::MachOLinkGraphBuilder:: NormalizedSection& NSec
llvm::jitlink::Symbol& Sym

virtual ~MachOLinkGraphBuilder()

Declared at: llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h:31