LLVM
15.0.0git
|
Symbol representation. More...
#include "llvm/ExecutionEngine/JITLink/JITLink.h"
Public Member Functions | |
Symbol ()=default | |
Create a null Symbol. More... | |
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. More... | |
StringRef | getName () const |
Returns the name of this symbol (empty if the symbol is anonymous). More... | |
void | setName (StringRef Name) |
Rename this symbol. More... | |
bool | isDefined () const |
Returns true if this Symbol has content (potentially) defined within this object file (i.e. More... | |
bool | isLive () const |
Returns true if this symbol is live (i.e. More... | |
void | setLive (bool IsLive) |
Set this symbol's live bit. More... | |
bool | isCallable () const |
Returns true is this symbol is callable. More... | |
void | setCallable (bool IsCallable) |
Set this symbol's callable bit. More... | |
bool | isExternal () const |
Returns true if the underlying addressable is an unresolved external. More... | |
bool | isAbsolute () const |
Returns true if the underlying addressable is an absolute symbol. More... | |
Addressable & | getAddressable () |
Return the addressable that this symbol points to. More... | |
const Addressable & | getAddressable () const |
Return the addressable that thsi symbol points to. More... | |
Block & | getBlock () |
Return the Block for this Symbol (Symbol must be defined). More... | |
const Block & | getBlock () const |
Return the Block for this Symbol (Symbol must be defined). More... | |
orc::ExecutorAddrDiff | getOffset () const |
Returns the offset for this symbol within the underlying addressable. More... | |
orc::ExecutorAddr | getAddress () const |
Returns the address of this symbol. More... | |
orc::ExecutorAddrDiff | getSize () const |
Returns the size of this symbol. More... | |
void | setSize (orc::ExecutorAddrDiff Size) |
Set the size of this symbol. More... | |
orc::ExecutorAddrRange | getRange () const |
Returns the address range of this symbol. More... | |
bool | isSymbolZeroFill () const |
Returns true if this symbol is backed by a zero-fill block. More... | |
ArrayRef< char > | getSymbolContent () const |
Returns the content in the underlying block covered by this symbol. More... | |
Linkage | getLinkage () const |
Get the linkage for this Symbol. More... | |
void | setLinkage (Linkage L) |
Set the linkage for this Symbol. More... | |
Scope | getScope () const |
Get the visibility for this Symbol. More... | |
void | setScope (Scope S) |
Set the visibility for this Symbol. More... | |
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 569 of file JITLink.h.
References llvm::sampleprof::Base, and Offset.
Referenced by llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), llvm::jitlink::SymbolAddressMap::addSymbol(), llvm::jitlink::x86_64::applyFixup(), getRange(), and llvm::jitlink::operator<<().
|
inline |
Return the addressable that this symbol points to.
Definition at line 540 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), and llvm::jitlink::LinkGraph::makeExternal().
|
inline |
Return the addressable that thsi symbol points to.
Definition at line 546 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
|
inline |
Return the Block for this Symbol (Symbol must be defined).
Definition at line 552 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), llvm::jitlink::getRISCVPCRelHi20(), getSymbolContent(), isSymbolZeroFill(), llvm::jitlink::LinkGraph::makeAbsolute(), llvm::jitlink::LinkGraph::makeExternal(), llvm::jitlink::LinkGraph::removeDefinedSymbol(), and llvm::jitlink::LinkGraph::transferDefinedSymbol().
|
inline |
Get the linkage for this Symbol.
Definition at line 600 of file JITLink.h.
Referenced by llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().
|
inline |
Returns the name of this symbol (empty if the symbol is anonymous).
Definition at line 494 of file JITLink.h.
References assert(), getScope(), and llvm::jitlink::Local.
Referenced by llvm::jitlink::LinkGraph::addAbsoluteSymbol(), llvm::jitlink::LinkGraph::addCommonSymbol(), llvm::jitlink::LinkGraph::addDefinedSymbol(), llvm::jitlink::LinkGraph::addExternalSymbol(), llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), llvm::jitlink::identifyELFSectionStartAndEndSymbols(), llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().
|
inline |
Returns the offset for this symbol within the underlying addressable.
Definition at line 566 of file JITLink.h.
References Offset.
Referenced by llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), llvm::jitlink::getRISCVPCRelHi20(), llvm::jitlink::LinkGraph::makeAbsolute(), llvm::jitlink::LinkGraph::makeExternal(), and llvm::jitlink::operator<<().
|
inline |
Returns the address range of this symbol.
Definition at line 585 of file JITLink.h.
References getAddress(), and getSize().
|
inline |
Get the visibility for this Symbol.
Definition at line 610 of file JITLink.h.
References S.
Referenced by getName(), llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().
|
inline |
Returns the size of this symbol.
Definition at line 572 of file JITLink.h.
References llvm::Check::Size.
Referenced by llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), getRange(), llvm::jitlink::operator<<(), and llvm::jitlink::LinkGraph::transferDefinedSymbol().
|
inline |
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 595 of file JITLink.h.
References getBlock(), llvm::jitlink::Block::getContent(), Offset, llvm::Check::Size, and llvm::ArrayRef< T >::slice().
|
inline |
Returns true if this symbol has a name.
Definition at line 491 of file JITLink.h.
Referenced by llvm::jitlink::operator<<().
|
inline |
Returns true if the underlying addressable is an absolute symbol.
Definition at line 534 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), llvm::jitlink::LinkGraph::makeDefined(), llvm::jitlink::LinkGraph::makeExternal(), llvm::jitlink::LinkGraph::removeAbsoluteSymbol(), and llvm::jitlink::LinkGraph::removeExternalSymbol().
|
inline |
|
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 506 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), llvm::jitlink::LinkGraph::makeDefined(), llvm::jitlink::LinkGraph::makeExternal(), llvm::jitlink::operator<<(), llvm::jitlink::LinkGraph::removeAbsoluteSymbol(), llvm::jitlink::LinkGraph::removeDefinedSymbol(), and llvm::jitlink::LinkGraph::removeExternalSymbol().
|
inline |
Returns true if the underlying addressable is an unresolved external.
Definition at line 528 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), and llvm::jitlink::LinkGraph::makeExternal().
|
inline |
Returns true if this symbol is live (i.e.
should be treated as a root for dead stripping).
Definition at line 513 of file JITLink.h.
References assert(), and llvm::sampleprof::Base.
Referenced by llvm::jitlink::operator<<().
|
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 591 of file JITLink.h.
References getBlock(), and llvm::jitlink::Block::isZeroFill().
|
inline |
|
inline |
Set the linkage for this Symbol.
Definition at line 603 of file JITLink.h.
References assert(), llvm::sampleprof::Base, and llvm::jitlink::Strong.
Referenced by llvm::jitlink::LinkGraph::makeDefined().
|
inline |
Set this symbol's live bit.
Definition at line 519 of file JITLink.h.
Referenced by llvm::jitlink::LinkGraph::makeDefined().
|
inline |
|
inline |
Set the visibility for this Symbol.
Definition at line 613 of file JITLink.h.
References assert(), llvm::sampleprof::Base, llvm::jitlink::Default, llvm::jitlink::Local, and S.
Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), and llvm::jitlink::LinkGraph::makeDefined().
|
inline |
Set the size of this symbol.
Definition at line 575 of file JITLink.h.
References assert(), llvm::sampleprof::Base, llvm::jitlink::Block::getSize(), Offset, and llvm::Check::Size.
Referenced by llvm::jitlink::LinkGraph::makeDefined(), and llvm::jitlink::LinkGraph::transferDefinedSymbol().