class COFFLinkGraphBuilder

Declaration

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

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

Member Variables

private std::vector<Optional<ComdatExportRequest>> PendingComdatExports
private std::vector<WeakExternalRequest> WeakExternalRequests
private std::vector<SymbolSet> SymbolSets
private const object::COFFObjectFile& Obj
private std::unique_ptr<LinkGraph> G
private llvm::jitlink::Section* CommonSection = nullptr
private std::vector<Block*> GraphBlocks
private std::vector<Symbol*> GraphSymbols
private DenseMap<llvm::StringRef, llvm::jitlink::Symbol*> ExternalSymbols

Method Overview

  • protected COFFLinkGraphBuilder(const object::COFFObjectFile & Obj, llvm::Triple TT, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
  • protected virtual llvm::Error addRelocations()
  • public Expected<std::unique_ptr<LinkGraph>> buildGraph()
  • private llvm::Error calculateImplicitSizeOfSymbols()
  • private Expected<llvm::jitlink::Symbol *> createCOMDATExportRequest(llvm::jitlink::COFFLinkGraphBuilder::COFFSymbolIndex SymIndex, object::COFFSymbolRef Symbol, const object::coff_aux_section_definition * Definition)
  • private Expected<llvm::jitlink::Symbol *> createDefinedSymbol(llvm::jitlink::COFFLinkGraphBuilder::COFFSymbolIndex SymIndex, llvm::StringRef SymbolName, object::COFFSymbolRef Symbol, const object::coff_section * Section)
  • private Expected<llvm::jitlink::Symbol *> exportCOMDATSymbol(llvm::jitlink::COFFLinkGraphBuilder::COFFSymbolIndex SymIndex, llvm::StringRef SymbolName, object::COFFSymbolRef Symbol)
  • private llvm::Error flushWeakAliasRequests()
  • protected template <typename ClassT, typename RelocHandlerMethod>llvm::Error forEachRelocation(const object::SectionRef & RelSec, ClassT * Instance, RelocHandlerMethod && Method, bool ProcessDebugSections = false)
  • protected template <typename RelocHandlerFunction>llvm::Error forEachRelocation(const object::SectionRef & RelSec, RelocHandlerFunction && Func, bool ProcessDebugSections = false)
  • private llvm::StringRef getCOFFSectionName(llvm::jitlink::COFFLinkGraphBuilder::COFFSectionIndex SectionIndex, const object::coff_section * Sec, object::COFFSymbolRef Sym)
  • private llvm::jitlink::Section & getCommonSection()
  • private static support::endianness getEndianness(const object::COFFObjectFile & Obj)
  • protected llvm::jitlink::LinkGraph & getGraph() const
  • protected llvm::jitlink::Block * getGraphBlock(llvm::jitlink::COFFLinkGraphBuilder::COFFSectionIndex SecIndex) const
  • protected llvm::jitlink::Symbol * getGraphSymbol(llvm::jitlink::COFFLinkGraphBuilder::COFFSymbolIndex SymIndex) const
  • protected const object::COFFObjectFile & getObject() const
  • private static unsigned int getPointerSize(const object::COFFObjectFile & Obj)
  • private static uint64_t getSectionAddress(const object::COFFObjectFile & Obj, const object::coff_section * Section)
  • private static uint64_t getSectionSize(const object::COFFObjectFile & Obj, const object::coff_section * Section)
  • protected llvm::Error graphifySections()
  • protected llvm::Error graphifySymbols()
  • private static bool isComdatSection(const object::coff_section * Section)
  • protected object::COFFObjectFile::section_iterator_range sections() const
  • protected void setGraphBlock(llvm::jitlink::COFFLinkGraphBuilder::COFFSectionIndex SecIndex, llvm::jitlink::Block * B)
  • protected void setGraphSymbol(llvm::jitlink::COFFLinkGraphBuilder::COFFSectionIndex SecIndex, llvm::jitlink::COFFLinkGraphBuilder::COFFSymbolIndex SymIndex, llvm::jitlink::Symbol & Sym)
  • public virtual ~COFFLinkGraphBuilder()

Methods

COFFLinkGraphBuilder(
    const object::COFFObjectFile& Obj,
    llvm::Triple TT,
    LinkGraph::GetEdgeKindNameFunction
        GetEdgeKindName)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:40

Parameters

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

virtual llvm::Error addRelocations()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:47

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

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:34

llvm::Error calculateImplicitSizeOfSymbols()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:146

Expected<llvm::jitlink::Symbol*>
createCOMDATExportRequest(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSymbolIndex SymIndex,
    object::COFFSymbolRef Symbol,
    const object::coff_aux_section_definition*
        Definition)

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

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSymbolIndex SymIndex
object::COFFSymbolRef Symbol
const object::coff_aux_section_definition* Definition

Expected<llvm::jitlink::Symbol*>
createDefinedSymbol(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSymbolIndex SymIndex,
    llvm::StringRef SymbolName,
    object::COFFSymbolRef Symbol,
    const object::coff_section* Section)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:135

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSymbolIndex SymIndex
llvm::StringRef SymbolName
object::COFFSymbolRef Symbol
const object::coff_section* Section

Expected<llvm::jitlink::Symbol*>
exportCOMDATSymbol(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSymbolIndex SymIndex,
    llvm::StringRef SymbolName,
    object::COFFSymbolRef Symbol)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:142

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSymbolIndex SymIndex
llvm::StringRef SymbolName
object::COFFSymbolRef Symbol

llvm::Error flushWeakAliasRequests()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:145

template <typename ClassT,
          typename RelocHandlerMethod>
llvm::Error forEachRelocation(
    const object::SectionRef& RelSec,
    ClassT* Instance,
    RelocHandlerMethod&& Method,
    bool ProcessDebugSections = false)

Description

Traverse all matching relocation records in the given section. Convenience wrapper to allow passing a member function for the handler.

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:98

Templates

ClassT
RelocHandlerMethod

Parameters

const object::SectionRef& RelSec
ClassT* Instance
RelocHandlerMethod&& Method
bool ProcessDebugSections = false

template <typename RelocHandlerFunction>
llvm::Error forEachRelocation(
    const object::SectionRef& RelSec,
    RelocHandlerFunction&& Func,
    bool ProcessDebugSections = false)

Description

Traverse all matching relocation records in the given section. The handler function Func should be callable with this signature: Error(const object::RelocationRef & , const object::SectionRef & , Section & )

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

Templates

RelocHandlerFunction

Parameters

const object::SectionRef& RelSec
RelocHandlerFunction&& Func
bool ProcessDebugSections = false

llvm::StringRef getCOFFSectionName(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSectionIndex SectionIndex,
    const object::coff_section* Sec,
    object::COFFSymbolRef Sym)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:155

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSectionIndex SectionIndex
const object::coff_section* Sec
object::COFFSymbolRef Sym

llvm::jitlink::Section& getCommonSection()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:133

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

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:154

Parameters

const object::COFFObjectFile& Obj

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

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:43

llvm::jitlink::Block* getGraphBlock(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSectionIndex SecIndex) const

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:73

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSectionIndex SecIndex

llvm::jitlink::Symbol* getGraphSymbol(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSymbolIndex SymIndex) const

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:60

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSymbolIndex SymIndex

const object::COFFObjectFile& getObject() const

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:45

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

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:153

Parameters

const object::COFFObjectFile& Obj

static uint64_t getSectionAddress(
    const object::COFFObjectFile& Obj,
    const object::coff_section* Section)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:148

Parameters

const object::COFFObjectFile& Obj
const object::coff_section* Section

static uint64_t getSectionSize(
    const object::COFFObjectFile& Obj,
    const object::coff_section* Section)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:150

Parameters

const object::COFFObjectFile& Obj
const object::coff_section* Section

llvm::Error graphifySections()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:49

llvm::Error graphifySymbols()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:50

static bool isComdatSection(
    const object::coff_section* Section)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:152

Parameters

const object::coff_section* Section

object::COFFObjectFile::section_iterator_range
sections() const

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:80

void setGraphBlock(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSectionIndex SecIndex,
    llvm::jitlink::Block* B)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:67

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSectionIndex SecIndex
llvm::jitlink::Block* B

void setGraphSymbol(
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSectionIndex SecIndex,
    llvm::jitlink::COFFLinkGraphBuilder::
        COFFSymbolIndex SymIndex,
    llvm::jitlink::Symbol& Sym)

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:52

Parameters

llvm::jitlink::COFFLinkGraphBuilder:: COFFSectionIndex SecIndex
llvm::jitlink::COFFLinkGraphBuilder:: COFFSymbolIndex SymIndex
llvm::jitlink::Symbol& Sym

virtual ~COFFLinkGraphBuilder()

Declared at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h:33