LLVM 20.0.0git
|
Symbol representation. More...
#include "llvm/ExecutionEngine/JITLink/JITLink.h"
Public Member Functions | |
Symbol ()=default | |
Create a null Symbol. | |
Symbol (const Symbol &)=delete | |
Symbol & | operator= (const Symbol &)=delete |
Symbol (Symbol &&)=delete | |
Symbol & | operator= (Symbol &&)=delete |
bool | hasName () const |
Returns true if this symbol has a name. | |
const orc::SymbolStringPtr & | getName () const |
Returns the name of this symbol (empty if the symbol is anonymous). | |
void | setName (const orc::SymbolStringPtr Name) |
Rename this symbol. | |
bool | isDefined () const |
Returns true if this Symbol has content (potentially) defined within this object file (i.e. | |
bool | isLive () const |
Returns true if this symbol is live (i.e. | |
void | setLive (bool IsLive) |
Set this symbol's live bit. | |
bool | isCallable () const |
Returns true is this symbol is callable. | |
void | setCallable (bool IsCallable) |
Set this symbol's callable bit. | |
bool | isExternal () const |
Returns true if the underlying addressable is an unresolved external. | |
bool | isAbsolute () const |
Returns true if the underlying addressable is an absolute symbol. | |
Addressable & | getAddressable () |
Return the addressable that this symbol points to. | |
const Addressable & | getAddressable () const |
Return the addressable that this symbol points to. | |
Block & | getBlock () |
Return the Block for this Symbol (Symbol must be defined). | |
const Block & | getBlock () const |
Return the Block for this Symbol (Symbol must be defined). | |
orc::ExecutorAddrDiff | getOffset () const |
Returns the offset for this symbol within the underlying addressable. | |
void | setOffset (orc::ExecutorAddrDiff NewOffset) |
orc::ExecutorAddr | getAddress () const |
Returns the address of this symbol. | |
orc::ExecutorAddrDiff | getSize () const |
Returns the size of this symbol. | |
void | setSize (orc::ExecutorAddrDiff Size) |
Set the size of this symbol. | |
orc::ExecutorAddrRange | getRange () const |
Returns the address range of this symbol. | |
bool | isSymbolZeroFill () const |
Returns true if this symbol is backed by a zero-fill block. | |
ArrayRef< char > | getSymbolContent () const |
Returns the content in the underlying block covered by this symbol. | |
Linkage | getLinkage () const |
Get the linkage for this Symbol. | |
void | setLinkage (Linkage L) |
Set the linkage for this Symbol. | |
Scope | getScope () const |
Get the visibility for this Symbol. | |
void | setScope (Scope S) |
Set the visibility for this Symbol. | |
TargetFlagsType | getTargetFlags () const |
Get the target flags of this Symbol. | |
void | setTargetFlags (TargetFlagsType Flags) |
Set the target flags for this Symbol. | |
bool | isWeaklyReferenced () const |
Returns true if this is a weakly referenced external symbol. | |
void | setWeaklyReferenced (bool WeakRef) |
Set the WeaklyReferenced value for this symbol. | |
Friends | |
class | LinkGraph |
Symbol representation.
Symbols represent locations within Addressable objects. They can be either Named or Anonymous. Anonymous symbols have neither linkage nor visibility, and must point at ContentBlocks. Named symbols may be in one of four states:
|
default |
Create a null Symbol.
This allows Symbols to be default initialized for use in containers (e.g. as map values). Null symbols are only useful for assigning to.
|
delete |
|
inline |
Returns the address of this symbol.
Definition at line 587 of file JITLink.h.
References llvm::sampleprof::Base, and Offset.
Referenced by llvm::jitlink::SymbolAddressMap::addSymbol(), llvm::jitlink::aarch64::applyFixup(), llvm::jitlink::i386::applyFixup(), llvm::jitlink::x86_64::applyFixup(), llvm::jitlink::ppc64::applyFixup(), llvm::jitlink::aarch32::applyFixupArm(), llvm::jitlink::aarch32::applyFixupData(), llvm::jitlink::aarch32::applyFixupThumb(), getMethodBatch(), getRange(), llvm::jitlink::makeTargetOutOfRangeError(), llvm::jitlink::operator<<(), llvm::orc::JITLinkReentryTrampolines::TrampolineAddrScraperPlugin::recordTrampolineAddrs(), and llvm::jitlink::relaxCall().
|
inline |
Return the addressable that this symbol points to.
Definition at line 553 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
|
inline |
Return the addressable that this symbol points to.
Definition at line 559 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
|
inline |
Return the Block for this Symbol (Symbol must be defined).
Definition at line 565 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by getMethodBatch(), getSymbolContent(), llvm::jitlink::initRelaxAux(), isSymbolZeroFill(), llvm::jitlink::makeTargetOutOfRangeError(), llvm::jitlink::prune(), setOffset(), llvm::jitlink::LinkGraph::transferBlock(), llvm::jitlink::aarch32::StubsManager_prev7::visitEdge(), and llvm::jitlink::aarch32::StubsManager_v7::visitEdge().
|
inline |
Get the linkage for this Symbol.
Definition at line 618 of file JITLink.h.
Referenced by llvm::orc::LinkGraphLayer::getJITSymbolFlagsForSymbol(), llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().
|
inline |
Returns the name of this symbol (empty if the symbol is anonymous).
Definition at line 506 of file JITLink.h.
References assert(), getScope(), hasName(), llvm::jitlink::Local, and Name.
Referenced by llvm::orc::LinkGraphLayer::getInterface(), getMethodBatch(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), llvm::jitlink::identifyELFSectionStartAndEndSymbols(), llvm::jitlink::identifyMachOSectionStartAndEndSymbols(), llvm::jitlink::makeTargetOutOfRangeError(), llvm::orc::LinkGraphLinkingLayer::JITLinkCtx::notifyResolved(), and llvm::jitlink::operator<<().
|
inline |
Returns the offset for this symbol within the underlying addressable.
Definition at line 579 of file JITLink.h.
References Offset.
Referenced by getMethodBatch(), llvm::jitlink::initRelaxAux(), llvm::jitlink::operator<<(), and llvm::jitlink::relaxBlock().
|
inline |
Returns the address range of this symbol.
Definition at line 603 of file JITLink.h.
References getAddress(), and getSize().
|
inline |
Get the visibility for this Symbol.
Definition at line 628 of file JITLink.h.
Referenced by llvm::orc::LinkGraphLayer::getInterface(), llvm::orc::LinkGraphLayer::getJITSymbolFlagsForSymbol(), getName(), llvm::jitlink::makeTargetOutOfRangeError(), llvm::orc::LinkGraphLinkingLayer::JITLinkCtx::notifyResolved(), and llvm::jitlink::operator<<().
|
inline |
Returns the size of this symbol.
Definition at line 590 of file JITLink.h.
References Size.
Referenced by getMethodBatch(), getRange(), llvm::jitlink::initRelaxAux(), llvm::jitlink::operator<<(), and setOffset().
Returns the content in the underlying block covered by this symbol.
This method may only be called on defined non-zero-fill symbols.
Definition at line 613 of file JITLink.h.
References getBlock(), llvm::jitlink::Block::getContent(), Offset, Size, and llvm::ArrayRef< T >::slice().
|
inline |
Get the target flags of this Symbol.
Definition at line 640 of file JITLink.h.
Referenced by llvm::jitlink::aarch32::StubsManager_v7::visitEdge().
|
inline |
Returns true if this symbol has a name.
Definition at line 503 of file JITLink.h.
References Name.
Referenced by llvm::orc::LinkGraphLayer::getInterface(), getName(), llvm::jitlink::makeTargetOutOfRangeError(), llvm::jitlink::operator<<(), llvm::orc::JITLinkReentryTrampolines::TrampolineAddrScraperPlugin::recordTrampolineAddrs(), and setScope().
|
inline |
Returns true if the underlying addressable is an absolute symbol.
Definition at line 547 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
|
inline |
Returns true is this symbol is callable.
Definition at line 535 of file JITLink.h.
Referenced by llvm::orc::LinkGraphLayer::getJITSymbolFlagsForSymbol(), and getMethodBatch().
|
inline |
Returns true if this Symbol has content (potentially) defined within this object file (i.e.
is anything but an external or absolute symbol).
Definition at line 519 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), llvm::jitlink::initRelaxAux(), and llvm::jitlink::operator<<().
|
inline |
Returns true if the underlying addressable is an unresolved external.
Definition at line 541 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), isWeaklyReferenced(), and setWeaklyReferenced().
|
inline |
Returns true if this symbol is live (i.e.
should be treated as a root for dead stripping).
Definition at line 526 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::operator<<(), and llvm::jitlink::prune().
|
inline |
Returns true if this symbol is backed by a zero-fill block.
This method may only be called on defined symbols.
Definition at line 609 of file JITLink.h.
References getBlock(), and llvm::jitlink::Block::isZeroFill().
|
inline |
Returns true if this is a weakly referenced external symbol.
This method may only be called on external symbols.
Definition at line 650 of file JITLink.h.
References assert(), and isExternal().
|
inline |
|
inline |
Set the linkage for this Symbol.
Definition at line 621 of file JITLink.h.
References assert(), llvm::sampleprof::Base, Name, and llvm::jitlink::Strong.
|
inline |
|
inline |
|
inline |
|
inline |
Set the visibility for this Symbol.
Definition at line 631 of file JITLink.h.
References assert(), llvm::sampleprof::Base, hasName(), and llvm::jitlink::Local.
|
inline |
Set the size of this symbol.
Definition at line 593 of file JITLink.h.
References assert(), llvm::sampleprof::Base, llvm::jitlink::Block::getSize(), Offset, and Size.
|
inline |
Set the target flags for this Symbol.
Definition at line 643 of file JITLink.h.
References assert().
Referenced by llvm::jitlink::aarch32::StubsManager_v7::visitEdge().
|
inline |
Set the WeaklyReferenced value for this symbol.
This method may only be called on external symbols.
Definition at line 657 of file JITLink.h.
References assert(), and isExternal().