LLVM  10.0.0svn
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::jitlink::Atom Class Reference

Base Atom class. Used by absolute and undefined atoms. More...

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

Inheritance diagram for llvm::jitlink::Atom:
Inheritance graph
[legend]
Collaboration diagram for llvm::jitlink::Atom:
Collaboration graph
[legend]

Public Member Functions

bool hasName () const
 Returns true if this atom has a name. More...
 
StringRef getName () const
 Returns the name of this atom. More...
 
JITTargetAddress getAddress () const
 Returns the current target address of this atom. More...
 
void setAddress (JITTargetAddress Address)
 Set the current target address of this atom. More...
 
bool isDefined () const
 Returns true if this is a defined atom. More...
 
bool isLive () const
 Returns true if this atom is marked as live. More...
 
void setLive (bool IsLive)
 Mark this atom as live. More...
 
bool shouldDiscard () const
 Returns true if this atom should be discarded during pruning. More...
 
void setShouldDiscard (bool ShouldDiscard)
 Mark this atom to be discarded. More...
 
bool isGlobal () const
 Returns true if this definition is global (i.e. More...
 
void setGlobal (bool IsGlobal)
 Mark this atom as global. More...
 
bool isAbsolute () const
 Returns true if this atom represents an absolute symbol. More...
 
bool isCallable () const
 Returns true if this atom is known to be callable. More...
 
void setCallable (bool IsCallable)
 Mark this atom as callable. More...
 
bool isExported () const
 Returns true if this atom should appear in the symbol table of a final linked image. More...
 
void setExported (bool IsExported)
 Mark this atom as exported. More...
 
bool isWeak () const
 Returns true if this is a weak symbol. More...
 
void setWeak (bool IsWeak)
 Mark this atom as weak. More...
 

Protected Member Functions

 Atom (StringRef Name)
 Create a named (as yet unresolved) atom. More...
 
 Atom (StringRef Name, JITTargetAddress Address)
 Create an absolute symbol atom. More...
 

Protected Attributes

bool HasLayoutNext: 1
 
bool IsCommon: 1
 

Friends

class AtomGraph
 

Detailed Description

Base Atom class. Used by absolute and undefined atoms.

Definition at line 102 of file JITLink.h.

Constructor & Destructor Documentation

◆ Atom() [1/2]

llvm::jitlink::Atom::Atom ( StringRef  Name)
inlineprotected

Create a named (as yet unresolved) atom.

Definition at line 107 of file JITLink.h.

◆ Atom() [2/2]

llvm::jitlink::Atom::Atom ( StringRef  Name,
JITTargetAddress  Address 
)
inlineprotected

Create an absolute symbol atom.

Definition at line 114 of file JITLink.h.

Member Function Documentation

◆ getAddress()

JITTargetAddress llvm::jitlink::Atom::getAddress ( ) const
inline

Returns the current target address of this atom.

The initial target address (for atoms that have one) will be taken from the input object file's virtual address space. During the layout phase of JIT linking the atom's address will be updated to point to its final address in the JIT'd process.

Definition at line 132 of file JITLink.h.

References llvm::Address.

Referenced by llvm::jitlink::AtomGraph::addAnonymousAtom(), llvm::jitlink::MachOAtomGraphBuilder::areLayoutLocked(), llvm::jitlink::Section::getRange(), llvm::jitlink::MachOJITLinker_x86_64::MachOJITLinker_x86_64(), llvm::jitlink::operator<<(), llvm::jitlink::printEdge(), and llvm::jitlink::AtomGraph::removeDefinedAtom().

◆ getName()

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

◆ hasName()

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

◆ isAbsolute()

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

Returns true if this atom represents an absolute symbol.

Definition at line 175 of file JITLink.h.

Referenced by llvm::jitlink::AtomGraph::removeAbsoluteAtom(), and llvm::jitlink::AtomGraph::removeExternalAtom().

◆ isCallable()

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

Returns true if this atom is known to be callable.

Primarily provided for easy interoperability with ORC, which uses the JITSymbolFlags::Common flag to identify symbols that can be interposed with stubs.

Definition at line 182 of file JITLink.h.

◆ isDefined()

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

Returns true if this is a defined atom.

Definition at line 138 of file JITLink.h.

Referenced by llvm::jitlink::MachOAtomGraphBuilder::areLayoutLocked(), llvm::jitlink::operator<<(), and llvm::jitlink::AtomGraph::removeExternalAtom().

◆ isExported()

bool llvm::jitlink::Atom::isExported ( ) const
inline

Returns true if this atom should appear in the symbol table of a final linked image.

Definition at line 193 of file JITLink.h.

◆ isGlobal()

bool llvm::jitlink::Atom::isGlobal ( ) const
inline

Returns true if this definition is global (i.e.

visible outside this linkage unit).

Note: This is distict from Exported, which means visibile outside the JITDylib that this graph is being linked in to.

Definition at line 169 of file JITLink.h.

◆ isLive()

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

Returns true if this atom is marked as live.

Definition at line 141 of file JITLink.h.

Referenced by llvm::jitlink::prune().

◆ isWeak()

bool llvm::jitlink::Atom::isWeak ( ) const
inline

Returns true if this is a weak symbol.

Definition at line 203 of file JITLink.h.

◆ setAddress()

void llvm::jitlink::Atom::setAddress ( JITTargetAddress  Address)
inline

Set the current target address of this atom.

Definition at line 135 of file JITLink.h.

◆ setCallable()

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

Mark this atom as callable.

Definition at line 185 of file JITLink.h.

References assert().

◆ setExported()

void llvm::jitlink::Atom::setExported ( bool  IsExported)
inline

Mark this atom as exported.

Definition at line 196 of file JITLink.h.

References assert().

◆ setGlobal()

void llvm::jitlink::Atom::setGlobal ( bool  IsGlobal)
inline

Mark this atom as global.

Definition at line 172 of file JITLink.h.

◆ setLive()

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

Mark this atom as live.

Note: Only defined and absolute atoms can be marked live.

Definition at line 146 of file JITLink.h.

References assert().

Referenced by llvm::jitlink::prune().

◆ setShouldDiscard()

void llvm::jitlink::Atom::setShouldDiscard ( bool  ShouldDiscard)
inline

Mark this atom to be discarded.

Note: Only defined and absolute atoms can be marked live.

Definition at line 158 of file JITLink.h.

References assert().

◆ setWeak()

void llvm::jitlink::Atom::setWeak ( bool  IsWeak)
inline

Mark this atom as weak.

Definition at line 206 of file JITLink.h.

References llvm::Address, and Name.

◆ shouldDiscard()

bool llvm::jitlink::Atom::shouldDiscard ( ) const
inline

Returns true if this atom should be discarded during pruning.

Definition at line 153 of file JITLink.h.

Referenced by llvm::jitlink::prune().

Friends And Related Function Documentation

◆ AtomGraph

friend class AtomGraph
friend

Definition at line 103 of file JITLink.h.

Member Data Documentation

◆ HasLayoutNext

bool llvm::jitlink::Atom::HasLayoutNext
protected

Definition at line 225 of file JITLink.h.

◆ IsCommon

bool llvm::jitlink::Atom::IsCommon
protected

Definition at line 226 of file JITLink.h.


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