LLVM 20.0.0git
|
#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, SubtargetFeatures Features, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName) | |
LinkGraph & | getGraph () const |
const object::MachOObjectFile & | getObject () const |
void | addCustomSectionParser (StringRef SectionName, SectionParserFunction Parse) |
virtual Error | addRelocations ()=0 |
template<typename... ArgTs> | |
NormalizedSymbol & | createNormalizedSymbol (ArgTs &&... Args) |
Create a symbol. | |
NormalizedSection & | getSectionByIndex (unsigned Index) |
Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range. | |
Expected< NormalizedSection & > | findSectionByIndex (unsigned Index) |
Try to get the section at the given index. | |
Expected< NormalizedSymbol & > | findSymbolByIndex (uint64_t Index) |
Try to get the symbol at the given index. | |
Symbol * | getSymbolByAddress (NormalizedSection &NSec, orc::ExecutorAddr Address) |
Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists. | |
Expected< Symbol & > | findSymbolByAddress (NormalizedSection &NSec, orc::ExecutorAddr Address) |
Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists. | |
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) |
Definition at line 29 of file MachOLinkGraphBuilder.h.
|
protected |
Definition at line 84 of file MachOLinkGraphBuilder.h.
|
virtualdefault |
|
protected |
Definition at line 49 of file MachOLinkGraphBuilder.cpp.
References llvm::object::MachOObjectFile::getHeader64(), llvm::MachO::MH_SUBSECTIONS_VIA_SYMBOLS, and string.
|
protected |
Definition at line 61 of file MachOLinkGraphBuilder.cpp.
References assert(), and llvm::StringMap< ValueTy, AllocatorTy >::count().
|
protectedpure virtual |
Referenced by buildGraph().
Definition at line 25 of file MachOLinkGraphBuilder.cpp.
References addRelocations(), and llvm::object::MachOObjectFile::isRelocatableObject().
|
inlineprotected |
Create a symbol.
Definition at line 101 of file MachOLinkGraphBuilder.h.
|
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 119 of file MachOLinkGraphBuilder.h.
References llvm::formatv(), and I.
|
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 151 of file MachOLinkGraphBuilder.h.
References llvm::Address, llvm::formatv(), getAddress(), getSymbolByAddress(), and Sym.
|
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 130 of file MachOLinkGraphBuilder.h.
References assert(), llvm::formatv(), and I.
|
inlineprotected |
Definition at line 90 of file MachOLinkGraphBuilder.h.
References G.
Definition at line 68 of file MachOLinkGraphBuilder.cpp.
References llvm::MachO::N_WEAK_DEF, llvm::MachO::N_WEAK_REF, llvm::jitlink::Strong, and llvm::jitlink::Weak.
|
inlineprotected |
Definition at line 92 of file MachOLinkGraphBuilder.h.
Referenced by getRelocationInfo().
|
inlineprotected |
Definition at line 169 of file MachOLinkGraphBuilder.h.
References getObject(), llvm::object::MachOObjectFile::getRelocation(), llvm::MachO::relocation_info::r_address, llvm::MachO::relocation_info::r_extern, llvm::MachO::relocation_info::r_length, llvm::MachO::relocation_info::r_pcrel, llvm::MachO::relocation_info::r_symbolnum, llvm::MachO::relocation_info::r_type, llvm::MachO::any_relocation_info::r_word0, and llvm::MachO::any_relocation_info::r_word1.
|
staticprotected |
Definition at line 74 of file MachOLinkGraphBuilder.cpp.
References llvm::jitlink::Default, llvm::jitlink::Hidden, llvm::jitlink::Local, llvm::MachO::N_EXT, llvm::MachO::N_PEXT, and Name.
|
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 110 of file MachOLinkGraphBuilder.h.
|
inlineprotected |
Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists.
Definition at line 141 of file MachOLinkGraphBuilder.h.
References llvm::Address, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::CanonicalSymbols, and I.
Referenced by findSymbolByAddress().
|
staticprotected |
Definition at line 84 of file MachOLinkGraphBuilder.cpp.
References llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Desc, and llvm::MachO::N_ALT_ENTRY.
|
staticprotected |
Definition at line 88 of file MachOLinkGraphBuilder.cpp.
References llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Flags, llvm::MachO::S_ATTR_DEBUG, and llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::SegName.
|
staticprotected |
Definition at line 93 of file MachOLinkGraphBuilder.cpp.
References llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Flags, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_THREAD_LOCAL_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.