LLVM  16.0.0git
Public Member Functions | Friends | List of all members
llvm::jitlink::Symbol Class Reference

Symbol representation. More...

#include "llvm/ExecutionEngine/JITLink/JITLink.h"

Public Member Functions

 Symbol ()=default
 Create a null Symbol. More...
 
 Symbol (const Symbol &)=delete
 
Symboloperator= (const Symbol &)=delete
 
 Symbol (Symbol &&)=delete
 
Symboloperator= (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...
 
AddressablegetAddressable ()
 Return the addressable that this symbol points to. More...
 
const AddressablegetAddressable () const
 Return the addressable that thsi symbol points to. More...
 
BlockgetBlock ()
 Return the Block for this Symbol (Symbol must be defined). More...
 
const BlockgetBlock () 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
 

Detailed Description

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:

Definition at line 401 of file JITLink.h.

Constructor & Destructor Documentation

◆ Symbol() [1/3]

llvm::jitlink::Symbol::Symbol ( )
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.

◆ Symbol() [2/3]

llvm::jitlink::Symbol::Symbol ( const Symbol )
delete

◆ Symbol() [3/3]

llvm::jitlink::Symbol::Symbol ( Symbol &&  )
delete

Member Function Documentation

◆ getAddress()

orc::ExecutorAddr llvm::jitlink::Symbol::getAddress ( ) const
inline

◆ getAddressable() [1/2]

Addressable& llvm::jitlink::Symbol::getAddressable ( )
inline

Return the addressable that this symbol points to.

Definition at line 537 of file JITLink.h.

References assert(), and llvm::sampleprof::Base.

Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), and llvm::jitlink::LinkGraph::makeExternal().

◆ getAddressable() [2/2]

const Addressable& llvm::jitlink::Symbol::getAddressable ( ) const
inline

Return the addressable that thsi symbol points to.

Definition at line 543 of file JITLink.h.

References assert(), and llvm::sampleprof::Base.

◆ getBlock() [1/2]

Block& llvm::jitlink::Symbol::getBlock ( )
inline

◆ getBlock() [2/2]

const Block& llvm::jitlink::Symbol::getBlock ( ) const
inline

Return the Block for this Symbol (Symbol must be defined).

Definition at line 556 of file JITLink.h.

References assert(), and llvm::sampleprof::Base.

◆ getLinkage()

Linkage llvm::jitlink::Symbol::getLinkage ( ) const
inline

Get the linkage for this Symbol.

Definition at line 597 of file JITLink.h.

Referenced by llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().

◆ getName()

StringRef llvm::jitlink::Symbol::getName ( ) const
inline

◆ getOffset()

orc::ExecutorAddrDiff llvm::jitlink::Symbol::getOffset ( ) const
inline

◆ getRange()

orc::ExecutorAddrRange llvm::jitlink::Symbol::getRange ( ) const
inline

Returns the address range of this symbol.

Definition at line 582 of file JITLink.h.

References getAddress(), and getSize().

◆ getScope()

Scope llvm::jitlink::Symbol::getScope ( ) const
inline

Get the visibility for this Symbol.

Definition at line 607 of file JITLink.h.

References S.

Referenced by getName(), llvm::jitlink::makeTargetOutOfRangeError(), and llvm::jitlink::operator<<().

◆ getSize()

orc::ExecutorAddrDiff llvm::jitlink::Symbol::getSize ( ) const
inline

◆ getSymbolContent()

ArrayRef<char> llvm::jitlink::Symbol::getSymbolContent ( ) const
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 592 of file JITLink.h.

References getBlock(), llvm::jitlink::Block::getContent(), Offset, Size, and llvm::ArrayRef< T >::slice().

◆ hasName()

bool llvm::jitlink::Symbol::hasName ( ) const
inline

Returns true if this symbol has a name.

Definition at line 488 of file JITLink.h.

Referenced by llvm::jitlink::operator<<().

◆ isAbsolute()

bool llvm::jitlink::Symbol::isAbsolute ( ) const
inline

◆ isCallable()

bool llvm::jitlink::Symbol::isCallable ( ) const
inline

Returns true is this symbol is callable.

Definition at line 519 of file JITLink.h.

◆ isDefined()

bool llvm::jitlink::Symbol::isDefined ( ) const
inline

◆ isExternal()

bool llvm::jitlink::Symbol::isExternal ( ) const
inline

Returns true if the underlying addressable is an unresolved external.

Definition at line 525 of file JITLink.h.

References assert(), and llvm::sampleprof::Base.

Referenced by llvm::jitlink::LinkGraph::makeAbsolute(), and llvm::jitlink::LinkGraph::makeExternal().

◆ isLive()

bool llvm::jitlink::Symbol::isLive ( ) const
inline

Returns true if this symbol is live (i.e.

should be treated as a root for dead stripping).

Definition at line 510 of file JITLink.h.

References assert(), and llvm::sampleprof::Base.

Referenced by llvm::jitlink::operator<<().

◆ isSymbolZeroFill()

bool llvm::jitlink::Symbol::isSymbolZeroFill ( ) const
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 588 of file JITLink.h.

References getBlock(), and llvm::jitlink::Block::isZeroFill().

◆ operator=() [1/2]

Symbol& llvm::jitlink::Symbol::operator= ( const Symbol )
delete

◆ operator=() [2/2]

Symbol& llvm::jitlink::Symbol::operator= ( Symbol &&  )
delete

◆ setCallable()

void llvm::jitlink::Symbol::setCallable ( bool  IsCallable)
inline

Set this symbol's callable bit.

Definition at line 522 of file JITLink.h.

◆ setLinkage()

void llvm::jitlink::Symbol::setLinkage ( Linkage  L)
inline

Set the linkage for this Symbol.

Definition at line 600 of file JITLink.h.

References assert(), llvm::sampleprof::Base, and llvm::jitlink::Strong.

Referenced by llvm::jitlink::LinkGraph::makeDefined().

◆ setLive()

void llvm::jitlink::Symbol::setLive ( bool  IsLive)
inline

Set this symbol's live bit.

Definition at line 516 of file JITLink.h.

Referenced by llvm::jitlink::LinkGraph::makeDefined().

◆ setName()

void llvm::jitlink::Symbol::setName ( StringRef  Name)
inline

Rename this symbol.

The client is responsible for updating scope and linkage if this name-change requires it.

Definition at line 499 of file JITLink.h.

◆ setScope()

void llvm::jitlink::Symbol::setScope ( Scope  S)
inline

◆ setSize()

void llvm::jitlink::Symbol::setSize ( orc::ExecutorAddrDiff  Size)
inline

Friends And Related Function Documentation

◆ LinkGraph

friend class LinkGraph
friend

Definition at line 402 of file JITLink.h.


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