LLVM 22.0.0git
llvm::jitlink::COFFLinkGraphBuilder Class Referenceabstract

#include "ExecutionEngine/JITLink/COFFLinkGraphBuilder.h"

Public Member Functions

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

Protected Types

using COFFSectionIndex = int32_t
using COFFSymbolIndex = int32_t

Protected Member Functions

 COFFLinkGraphBuilder (const object::COFFObjectFile &Obj, std::shared_ptr< orc::SymbolStringPool > SSP, Triple TT, SubtargetFeatures Features, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
LinkGraphgetGraph () const
const object::COFFObjectFilegetObject () const
virtual Error addRelocations ()=0
Error graphifySections ()
Error graphifySymbols ()
void setGraphSymbol (COFFSectionIndex SecIndex, COFFSymbolIndex SymIndex, Symbol &Sym)
SymbolgetGraphSymbol (COFFSymbolIndex SymIndex) const
void setGraphBlock (COFFSectionIndex SecIndex, Block *B)
BlockgetGraphBlock (COFFSectionIndex SecIndex) const
SymboladdImageBaseSymbol (StringRef Name="__ImageBase")
object::COFFObjectFile::section_iterator_range sections () const
template<typename RelocHandlerFunction>
Error forEachRelocation (const object::SectionRef &RelSec, RelocHandlerFunction &&Func, bool ProcessDebugSections=false)
 Traverse all matching relocation records in the given section.
template<typename ClassT, typename RelocHandlerMethod>
Error forEachRelocation (const object::SectionRef &RelSec, ClassT *Instance, RelocHandlerMethod &&Method, bool ProcessDebugSections=false)
 Traverse all matching relocation records in the given section.

Detailed Description

Definition at line 31 of file COFFLinkGraphBuilder.h.

Member Typedef Documentation

◆ COFFSectionIndex

Definition at line 37 of file COFFLinkGraphBuilder.h.

◆ COFFSymbolIndex

Definition at line 38 of file COFFLinkGraphBuilder.h.

Constructor & Destructor Documentation

◆ ~COFFLinkGraphBuilder()

llvm::jitlink::COFFLinkGraphBuilder::~COFFLinkGraphBuilder ( )
virtualdefault

◆ COFFLinkGraphBuilder()

llvm::jitlink::COFFLinkGraphBuilder::COFFLinkGraphBuilder ( const object::COFFObjectFile & Obj,
std::shared_ptr< orc::SymbolStringPool > SSP,
Triple TT,
SubtargetFeatures Features,
LinkGraph::GetEdgeKindNameFunction GetEdgeKindName )
protected

Member Function Documentation

◆ addImageBaseSymbol()

Symbol & llvm::jitlink::COFFLinkGraphBuilder::addImageBaseSymbol ( StringRef Name = "__ImageBase")
inlineprotected

Definition at line 82 of file COFFLinkGraphBuilder.h.

References llvm::jitlink::Symbol::setLive().

◆ addRelocations()

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

Referenced by buildGraph().

◆ buildGraph()

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

◆ forEachRelocation() [1/2]

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

Traverse all matching relocation records in the given section.

Convenience wrapper to allow passing a member function for the handler.

Definition at line 106 of file COFFLinkGraphBuilder.h.

References forEachRelocation().

◆ forEachRelocation() [2/2]

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

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 &)

Definition at line 193 of file COFFLinkGraphBuilder.h.

References llvm::dbgs(), getGraphBlock(), llvm::object::SectionRef::getIndex(), llvm::inconvertibleErrorCode(), LLVM_DEBUG, llvm::make_error(), llvm::object::SectionRef::relocations(), and llvm::Error::success().

Referenced by forEachRelocation().

◆ getGraph()

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

Definition at line 45 of file COFFLinkGraphBuilder.h.

◆ getGraphBlock()

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

Definition at line 75 of file COFFLinkGraphBuilder.h.

Referenced by forEachRelocation().

◆ getGraphSymbol()

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

Definition at line 62 of file COFFLinkGraphBuilder.h.

◆ getObject()

const object::COFFObjectFile & llvm::jitlink::COFFLinkGraphBuilder::getObject ( ) const
inlineprotected

Definition at line 47 of file COFFLinkGraphBuilder.h.

◆ graphifySections()

◆ graphifySymbols()

Error llvm::jitlink::COFFLinkGraphBuilder::graphifySymbols ( )
protected

◆ sections()

object::COFFObjectFile::section_iterator_range llvm::jitlink::COFFLinkGraphBuilder::sections ( ) const
inlineprotected

Definition at line 88 of file COFFLinkGraphBuilder.h.

◆ setGraphBlock()

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

Definition at line 69 of file COFFLinkGraphBuilder.h.

References assert(), B(), and llvm::COFF::isReservedSectionNumber().

Referenced by graphifySections().

◆ setGraphSymbol()

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

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