LLVM  10.0.0svn
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...
 
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...
 
JITTargetAddress getOffset () const
 Returns the offset for this symbol within the underlying addressable. More...
 
JITTargetAddress getAddress () const
 Returns the address of this symbol. More...
 
JITTargetAddress getSize () const
 Returns the size of this symbol. More...
 
bool isSymbolZeroFill () const
 Returns true if this symbol is backed by a zero-fill block. More...
 
StringRef 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 282 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()

JITTargetAddress 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 412 of file JITLink.h.

References assert().

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

◆ getAddressable() [2/2]

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

Return the addressable that thsi symbol points to.

Definition at line 418 of file JITLink.h.

References assert().

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

References assert(), and llvm::jitlink::Addressable::isDefined().

◆ getLinkage()

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

Get the linkage for this Symbol.

Definition at line 457 of file JITLink.h.

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

◆ getName()

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

◆ getOffset()

JITTargetAddress llvm::jitlink::Symbol::getOffset ( ) const
inline

Returns the offset for this symbol within the underlying addressable.

Definition at line 438 of file JITLink.h.

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

◆ getScope()

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

Get the visibility for this Symbol.

Definition at line 467 of file JITLink.h.

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

◆ getSize()

JITTargetAddress llvm::jitlink::Symbol::getSize ( ) const
inline

Returns the size of this symbol.

Definition at line 444 of file JITLink.h.

References Size.

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

◆ getSymbolContent()

StringRef 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 452 of file JITLink.h.

References llvm::StringRef::substr().

◆ hasName()

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

◆ isAbsolute()

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

Returns true if the underlying addressable is an absolute symbol.

Definition at line 406 of file JITLink.h.

References assert(), llvm::jitlink::Addressable::isAbsolute(), and llvm::jitlink::Addressable::isDefined().

Referenced by llvm::jitlink::LinkGraph::removeAbsoluteSymbol(), and llvm::jitlink::LinkGraph::removeExternalSymbol().

◆ isCallable()

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

Returns true is this symbol is callable.

Definition at line 394 of file JITLink.h.

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

References assert(), and llvm::jitlink::Addressable::isDefined().

Referenced by llvm::jitlink::LinkGraph::makeExternal(), llvm::jitlink::operator<<(), llvm::jitlink::LinkGraph::removeAbsoluteSymbol(), llvm::jitlink::LinkGraph::removeDefinedSymbol(), and llvm::jitlink::LinkGraph::removeExternalSymbol().

◆ isExternal()

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

Returns true if the underlying addressable is an unresolved external.

Definition at line 400 of file JITLink.h.

References assert(), llvm::jitlink::Addressable::isAbsolute(), and llvm::jitlink::Addressable::isDefined().

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

References assert().

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

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

◆ setLinkage()

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

Set the linkage for this Symbol.

Definition at line 460 of file JITLink.h.

References assert(), llvm::StringRef::empty(), llvm::jitlink::Addressable::isDefined(), and llvm::jitlink::Strong.

◆ setLive()

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

Set this symbol's live bit.

Definition at line 391 of file JITLink.h.

◆ setScope()

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

Friends And Related Function Documentation

◆ LinkGraph

friend class LinkGraph
friend

Definition at line 283 of file JITLink.h.


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