LLVM  14.0.0git
Public Types | Public Member Functions | List of all members
llvm::JITSymbol Class Reference

Represents a symbol in the JIT. More...

#include "llvm/ExecutionEngine/JITSymbol.h"

Collaboration diagram for llvm::JITSymbol:
Collaboration graph
[legend]

Public Types

using GetAddressFtor = unique_function< Expected< JITTargetAddress >()>
 

Public Member Functions

 JITSymbol (std::nullptr_t)
 Create a 'null' symbol, used to represent a "symbol not found" result from a successful (non-erroneous) lookup. More...
 
 JITSymbol (Error Err)
 Create a JITSymbol representing an error in the symbol lookup process (e.g. More...
 
 JITSymbol (JITTargetAddress Addr, JITSymbolFlags Flags)
 Create a symbol for a definition with a known address. More...
 
 JITSymbol (JITEvaluatedSymbol Sym)
 Construct a JITSymbol from a JITEvaluatedSymbol. More...
 
 JITSymbol (GetAddressFtor GetAddress, JITSymbolFlags Flags)
 Create a symbol for a definition that doesn't have a known address yet. More...
 
 JITSymbol (const JITSymbol &)=delete
 
JITSymboloperator= (const JITSymbol &)=delete
 
 JITSymbol (JITSymbol &&Other)
 
JITSymboloperator= (JITSymbol &&Other)
 
 ~JITSymbol ()
 
 operator bool () const
 Returns true if the symbol exists, false otherwise. More...
 
Error takeError ()
 Move the error field value out of this JITSymbol. More...
 
Expected< JITTargetAddressgetAddress ()
 Get the address of the symbol in the target address space. More...
 
JITSymbolFlags getFlags () const
 

Detailed Description

Represents a symbol in the JIT.

Definition at line 265 of file JITSymbol.h.

Member Typedef Documentation

◆ GetAddressFtor

Definition at line 267 of file JITSymbol.h.

Constructor & Destructor Documentation

◆ JITSymbol() [1/7]

llvm::JITSymbol::JITSymbol ( std::nullptr_t  )
inline

Create a 'null' symbol, used to represent a "symbol not found" result from a successful (non-erroneous) lookup.

Definition at line 271 of file JITSymbol.h.

◆ JITSymbol() [2/7]

llvm::JITSymbol::JITSymbol ( Error  Err)
inline

Create a JITSymbol representing an error in the symbol lookup process (e.g.

a network failure during a remote lookup).

Definition at line 276 of file JITSymbol.h.

◆ JITSymbol() [3/7]

llvm::JITSymbol::JITSymbol ( JITTargetAddress  Addr,
JITSymbolFlags  Flags 
)
inline

Create a symbol for a definition with a known address.

Definition at line 280 of file JITSymbol.h.

◆ JITSymbol() [4/7]

llvm::JITSymbol::JITSymbol ( JITEvaluatedSymbol  Sym)
inline

Construct a JITSymbol from a JITEvaluatedSymbol.

Definition at line 284 of file JITSymbol.h.

◆ JITSymbol() [5/7]

llvm::JITSymbol::JITSymbol ( GetAddressFtor  GetAddress,
JITSymbolFlags  Flags 
)
inline

Create a symbol for a definition that doesn't have a known address yet.

Parameters
GetAddressA functor to materialize a definition (fixing the address) on demand.

This constructor allows a JIT layer to provide a reference to a symbol definition without actually materializing the definition up front. The user can materialize the definition at any time by calling the getAddress method.

Definition at line 296 of file JITSymbol.h.

◆ JITSymbol() [6/7]

llvm::JITSymbol::JITSymbol ( const JITSymbol )
delete

◆ JITSymbol() [7/7]

llvm::JITSymbol::JITSymbol ( JITSymbol &&  Other)
inline

Definition at line 302 of file JITSymbol.h.

References CachedAddr, Err, llvm::JITSymbolFlags::hasError(), move, and Other.

◆ ~JITSymbol()

llvm::JITSymbol::~JITSymbol ( )
inline

Definition at line 320 of file JITSymbol.h.

References CachedAddr, Err, llvm::JITSymbolFlags::hasError(), and llvm::Error::~Error().

Member Function Documentation

◆ getAddress()

Expected<JITTargetAddress> llvm::JITSymbol::getAddress ( )
inline

Get the address of the symbol in the target address space.

Returns '0' if the symbol does not exist.

Definition at line 341 of file JITSymbol.h.

References assert(), CachedAddr, and llvm::JITSymbolFlags::hasError().

◆ getFlags()

JITSymbolFlags llvm::JITSymbol::getFlags ( ) const
inline

Definition at line 354 of file JITSymbol.h.

◆ operator bool()

llvm::JITSymbol::operator bool ( ) const
inlineexplicit

Returns true if the symbol exists, false otherwise.

Definition at line 328 of file JITSymbol.h.

References CachedAddr, and llvm::JITSymbolFlags::hasError().

◆ operator=() [1/2]

JITSymbol& llvm::JITSymbol::operator= ( const JITSymbol )
delete

◆ operator=() [2/2]

JITSymbol& llvm::JITSymbol::operator= ( JITSymbol &&  Other)
inline

Definition at line 310 of file JITSymbol.h.

References CachedAddr, Err, llvm::JITSymbolFlags::hasError(), move, and Other.

◆ takeError()

Error llvm::JITSymbol::takeError ( )
inline

Move the error field value out of this JITSymbol.

Definition at line 333 of file JITSymbol.h.

References Err, llvm::JITSymbolFlags::hasError(), move, and llvm::Error::success().

Member Data Documentation

◆ CachedAddr

JITTargetAddress llvm::JITSymbol::CachedAddr

Definition at line 359 of file JITSymbol.h.

Referenced by getAddress(), JITSymbol(), operator bool(), operator=(), and ~JITSymbol().

◆ Err

Error llvm::JITSymbol::Err

Definition at line 360 of file JITSymbol.h.

Referenced by JITSymbol(), operator=(), takeError(), and ~JITSymbol().


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