LLVM 19.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.
 
 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.
 
StringRef getName () const
 Returns the name of this symbol (empty if the symbol is anonymous).
 
void setName (StringRef 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.
 
AddressablegetAddressable ()
 Return the addressable that this symbol points to.
 
const AddressablegetAddressable () const
 Return the addressable that this symbol points to.
 
BlockgetBlock ()
 Return the Block for this Symbol (Symbol must be defined).
 
const BlockgetBlock () 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< chargetSymbolContent () 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
 

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 416 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 542 of file JITLink.h.

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

◆ getAddressable() [2/2]

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

Return the addressable that this symbol points to.

Definition at line 548 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 561 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 607 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

Returns the offset for this symbol within the underlying addressable.

Definition at line 568 of file JITLink.h.

References Offset.

Referenced by getMethodBatch(), llvm::jitlink::initRelaxAux(), llvm::jitlink::operator<<(), and llvm::jitlink::relaxBlock().

◆ getRange()

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

Returns the address range of this symbol.

Definition at line 592 of file JITLink.h.

References getAddress(), and getSize().

◆ getScope()

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

◆ getSize()

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

Returns the size of this symbol.

Definition at line 579 of file JITLink.h.

References Size.

Referenced by getMethodBatch(), getRange(), llvm::jitlink::initRelaxAux(), llvm::jitlink::operator<<(), and setOffset().

◆ 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 602 of file JITLink.h.

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

◆ getTargetFlags()

TargetFlagsType llvm::jitlink::Symbol::getTargetFlags ( ) const
inline

Get the target flags of this Symbol.

Definition at line 629 of file JITLink.h.

Referenced by llvm::jitlink::aarch32::StubsManager_v7::visitEdge().

◆ hasName()

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

Returns true if this symbol has a name.

Definition at line 493 of file JITLink.h.

References Name.

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

◆ isAbsolute()

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

Returns true if the underlying addressable is an absolute symbol.

Definition at line 536 of file JITLink.h.

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

◆ isCallable()

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

Returns true is this symbol is callable.

Definition at line 524 of file JITLink.h.

Referenced by getMethodBatch().

◆ isDefined()

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

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

Referenced by llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), llvm::jitlink::initRelaxAux(), and llvm::jitlink::operator<<().

◆ isExternal()

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

Returns true if the underlying addressable is an unresolved external.

Definition at line 530 of file JITLink.h.

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

Referenced by llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), isWeaklyReferenced(), and setWeaklyReferenced().

◆ 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 515 of file JITLink.h.

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

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

◆ 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 598 of file JITLink.h.

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

◆ isWeaklyReferenced()

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

Returns true if this is a weakly referenced external symbol.

This method may only be called on external symbols.

Definition at line 639 of file JITLink.h.

References assert(), and isExternal().

◆ 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 527 of file JITLink.h.

◆ setLinkage()

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

Set the linkage for this Symbol.

Definition at line 610 of file JITLink.h.

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

◆ setLive()

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

Set this symbol's live bit.

Definition at line 521 of file JITLink.h.

◆ 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 504 of file JITLink.h.

References Name.

◆ setOffset()

void llvm::jitlink::Symbol::setOffset ( orc::ExecutorAddrDiff  NewOffset)
inline

Definition at line 570 of file JITLink.h.

References assert(), getBlock(), getSize(), and Offset.

◆ setScope()

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

Set the visibility for this Symbol.

Definition at line 620 of file JITLink.h.

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

◆ setSize()

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

Set the size of this symbol.

Definition at line 582 of file JITLink.h.

References assert(), llvm::sampleprof::Base, llvm::jitlink::Block::getSize(), Offset, and Size.

◆ setTargetFlags()

void llvm::jitlink::Symbol::setTargetFlags ( TargetFlagsType  Flags)
inline

Set the target flags for this Symbol.

Definition at line 632 of file JITLink.h.

References assert().

Referenced by llvm::jitlink::aarch32::StubsManager_v7::visitEdge().

◆ setWeaklyReferenced()

void llvm::jitlink::Symbol::setWeaklyReferenced ( bool  WeakRef)
inline

Set the WeaklyReferenced value for this symbol.

This method may only be called on external symbols.

Definition at line 646 of file JITLink.h.

References assert(), and isExternal().

Friends And Related Function Documentation

◆ LinkGraph

friend class LinkGraph
friend

Definition at line 417 of file JITLink.h.


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