LLVM 20.0.0git
Classes | Public Member Functions | Protected Types | Protected Member Functions | List of all members
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, 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
 
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,
Triple  TT,
SubtargetFeatures  Features,
LinkGraph::GetEdgeKindNameFunction  GetEdgeKindName 
)
protected

Member Function Documentation

◆ addRelocations()

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

Referenced by buildGraph().

◆ buildGraph()

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

Definition at line 79 of file COFFLinkGraphBuilder.cpp.

References addRelocations(), graphifySections(), and graphifySymbols().

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

References llvm::dbgs(), llvm::object::COFFObjectFile::getCOFFSection(), getGraphBlock(), llvm::object::SectionRef::getIndex(), llvm::object::COFFObjectFile::getSectionName(), llvm::inconvertibleErrorCode(), LLVM_DEBUG, Name, llvm::object::SectionRef::relocations(), and llvm::Error::success().

Referenced by forEachRelocation().

◆ getGraph()

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

Definition at line 44 of file COFFLinkGraphBuilder.h.

◆ getGraphBlock()

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

Definition at line 74 of file COFFLinkGraphBuilder.h.

Referenced by forEachRelocation().

◆ getGraphSymbol()

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

Definition at line 61 of file COFFLinkGraphBuilder.h.

◆ getObject()

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

Definition at line 46 of file COFFLinkGraphBuilder.h.

◆ graphifySections()

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

◆ graphifySymbols()

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

◆ sections()

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

Definition at line 81 of file COFFLinkGraphBuilder.h.

References llvm::object::ObjectFile::sections().

◆ setGraphBlock()

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

Definition at line 68 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

Definition at line 53 of file COFFLinkGraphBuilder.h.

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

Referenced by graphifySymbols().


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