LLVM 20.0.0git
Modules | Classes | Typedefs | Functions
Collaboration diagram for Execution Engine:

Modules

 LLJIT
 
 On-Request-Compilation
 
 ExecutionEngine-based ORC Utils
 

Classes

struct  LLVMMCJITCompilerOptions
 

Typedefs

typedef struct LLVMOpaqueGenericValue * LLVMGenericValueRef
 
typedef struct LLVMOpaqueExecutionEngine * LLVMExecutionEngineRef
 
typedef struct LLVMOpaqueMCJITMemoryManager * LLVMMCJITMemoryManagerRef
 
typedef uint8_t *(* LLVMMemoryManagerAllocateCodeSectionCallback) (void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName)
 
typedef uint8_t *(* LLVMMemoryManagerAllocateDataSectionCallback) (void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName, LLVMBool IsReadOnly)
 
typedef LLVMBool(* LLVMMemoryManagerFinalizeMemoryCallback) (void *Opaque, char **ErrMsg)
 
typedef void(* LLVMMemoryManagerDestroyCallback) (void *Opaque)
 

Functions

void LLVMLinkInMCJIT (void)
 
void LLVMLinkInInterpreter (void)
 
LLVMGenericValueRef LLVMCreateGenericValueOfInt (LLVMTypeRef Ty, unsigned long long N, LLVMBool IsSigned)
 
LLVMGenericValueRef LLVMCreateGenericValueOfPointer (void *P)
 
LLVMGenericValueRef LLVMCreateGenericValueOfFloat (LLVMTypeRef Ty, double N)
 
unsigned LLVMGenericValueIntWidth (LLVMGenericValueRef GenValRef)
 
unsigned long long LLVMGenericValueToInt (LLVMGenericValueRef GenVal, LLVMBool IsSigned)
 
void * LLVMGenericValueToPointer (LLVMGenericValueRef GenVal)
 
double LLVMGenericValueToFloat (LLVMTypeRef TyRef, LLVMGenericValueRef GenVal)
 
void LLVMDisposeGenericValue (LLVMGenericValueRef GenVal)
 
LLVMBool LLVMCreateExecutionEngineForModule (LLVMExecutionEngineRef *OutEE, LLVMModuleRef M, char **OutError)
 
LLVMBool LLVMCreateInterpreterForModule (LLVMExecutionEngineRef *OutInterp, LLVMModuleRef M, char **OutError)
 
LLVMBool LLVMCreateJITCompilerForModule (LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, unsigned OptLevel, char **OutError)
 
void LLVMInitializeMCJITCompilerOptions (struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions)
 
LLVMBool LLVMCreateMCJITCompilerForModule (LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions, char **OutError)
 Create an MCJIT execution engine for a module, with the given options.
 
void LLVMDisposeExecutionEngine (LLVMExecutionEngineRef EE)
 
void LLVMRunStaticConstructors (LLVMExecutionEngineRef EE)
 
void LLVMRunStaticDestructors (LLVMExecutionEngineRef EE)
 
int LLVMRunFunctionAsMain (LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned ArgC, const char *const *ArgV, const char *const *EnvP)
 
LLVMGenericValueRef LLVMRunFunction (LLVMExecutionEngineRef EE, LLVMValueRef F, unsigned NumArgs, LLVMGenericValueRef *Args)
 
void LLVMFreeMachineCodeForFunction (LLVMExecutionEngineRef EE, LLVMValueRef F)
 
void LLVMAddModule (LLVMExecutionEngineRef EE, LLVMModuleRef M)
 
LLVMBool LLVMRemoveModule (LLVMExecutionEngineRef EE, LLVMModuleRef M, LLVMModuleRef *OutMod, char **OutError)
 
LLVMBool LLVMFindFunction (LLVMExecutionEngineRef EE, const char *Name, LLVMValueRef *OutFn)
 
void * LLVMRecompileAndRelinkFunction (LLVMExecutionEngineRef EE, LLVMValueRef Fn)
 
LLVMTargetDataRef LLVMGetExecutionEngineTargetData (LLVMExecutionEngineRef EE)
 
LLVMTargetMachineRef LLVMGetExecutionEngineTargetMachine (LLVMExecutionEngineRef EE)
 
void LLVMAddGlobalMapping (LLVMExecutionEngineRef EE, LLVMValueRef Global, void *Addr)
 
void * LLVMGetPointerToGlobal (LLVMExecutionEngineRef EE, LLVMValueRef Global)
 
uint64_t LLVMGetGlobalValueAddress (LLVMExecutionEngineRef EE, const char *Name)
 
uint64_t LLVMGetFunctionAddress (LLVMExecutionEngineRef EE, const char *Name)
 
LLVMBool LLVMExecutionEngineGetErrMsg (LLVMExecutionEngineRef EE, char **OutError)
 Returns true on error, false on success.
 
LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager (void *Opaque, LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, LLVMMemoryManagerDestroyCallback Destroy)
 Create a simple custom MCJIT memory manager.
 
void LLVMDisposeMCJITMemoryManager (LLVMMCJITMemoryManagerRef MM)
 
LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener (void)
 
LLVMJITEventListenerRef LLVMCreateIntelJITEventListener (void)
 
LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener (void)
 
LLVMJITEventListenerRef LLVMCreatePerfJITEventListener (void)
 

Detailed Description

Typedef Documentation

◆ LLVMExecutionEngineRef

typedef struct LLVMOpaqueExecutionEngine* LLVMExecutionEngineRef

Definition at line 40 of file ExecutionEngine.h.

◆ LLVMGenericValueRef

typedef struct LLVMOpaqueGenericValue* LLVMGenericValueRef

Definition at line 39 of file ExecutionEngine.h.

◆ LLVMMCJITMemoryManagerRef

typedef struct LLVMOpaqueMCJITMemoryManager* LLVMMCJITMemoryManagerRef

Definition at line 41 of file ExecutionEngine.h.

◆ LLVMMemoryManagerAllocateCodeSectionCallback

typedef uint8_t *(* LLVMMemoryManagerAllocateCodeSectionCallback) (void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName)

Definition at line 159 of file ExecutionEngine.h.

◆ LLVMMemoryManagerAllocateDataSectionCallback

typedef uint8_t *(* LLVMMemoryManagerAllocateDataSectionCallback) (void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, const char *SectionName, LLVMBool IsReadOnly)

Definition at line 162 of file ExecutionEngine.h.

◆ LLVMMemoryManagerDestroyCallback

typedef void(* LLVMMemoryManagerDestroyCallback) (void *Opaque)

Definition at line 167 of file ExecutionEngine.h.

◆ LLVMMemoryManagerFinalizeMemoryCallback

typedef LLVMBool(* LLVMMemoryManagerFinalizeMemoryCallback) (void *Opaque, char **ErrMsg)

Definition at line 165 of file ExecutionEngine.h.

Function Documentation

◆ LLVMAddGlobalMapping()

void LLVMAddGlobalMapping ( LLVMExecutionEngineRef  EE,
LLVMValueRef  Global,
void *  Addr 
)

Definition at line 292 of file ExecutionEngineBindings.cpp.

References Addr, llvm::Global, and llvm::unwrap().

◆ LLVMAddModule()

void LLVMAddModule ( LLVMExecutionEngineRef  EE,
LLVMModuleRef  M 
)

Definition at line 257 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMCreateExecutionEngineForModule()

LLVMBool LLVMCreateExecutionEngineForModule ( LLVMExecutionEngineRef OutEE,
LLVMModuleRef  M,
char **  OutError 
)

◆ LLVMCreateGDBRegistrationListener()

LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener ( void  )

◆ LLVMCreateGenericValueOfFloat()

LLVMGenericValueRef LLVMCreateGenericValueOfFloat ( LLVMTypeRef  Ty,
double  N 
)

◆ LLVMCreateGenericValueOfInt()

LLVMGenericValueRef LLVMCreateGenericValueOfInt ( LLVMTypeRef  Ty,
unsigned long long  N,
LLVMBool  IsSigned 
)

Definition at line 41 of file ExecutionEngineBindings.cpp.

References getBitWidth(), llvm::GenericValue::IntVal, N, and wrap().

◆ LLVMCreateGenericValueOfPointer()

LLVMGenericValueRef LLVMCreateGenericValueOfPointer ( void *  P)

Definition at line 49 of file ExecutionEngineBindings.cpp.

References P, llvm::GenericValue::PointerVal, and wrap().

◆ LLVMCreateIntelJITEventListener()

LLVMJITEventListenerRef LLVMCreateIntelJITEventListener ( void  )

◆ LLVMCreateInterpreterForModule()

LLVMBool LLVMCreateInterpreterForModule ( LLVMExecutionEngineRef OutInterp,
LLVMModuleRef  M,
char **  OutError 
)

◆ LLVMCreateJITCompilerForModule()

LLVMBool LLVMCreateJITCompilerForModule ( LLVMExecutionEngineRef OutJIT,
LLVMModuleRef  M,
unsigned  OptLevel,
char **  OutError 
)

◆ LLVMCreateMCJITCompilerForModule()

LLVMBool LLVMCreateMCJITCompilerForModule ( LLVMExecutionEngineRef OutJIT,
LLVMModuleRef  M,
struct LLVMMCJITCompilerOptions Options,
size_t  SizeOfOptions,
char **  OutError 
)

Create an MCJIT execution engine for a module, with the given options.

It is the responsibility of the caller to ensure that all fields in Options up to the given SizeOfOptions are initialized. It is correct to pass a smaller value of SizeOfOptions that omits some fields. The canonical way of using this is:

LLVMMCJITCompilerOptions options; LLVMInitializeMCJITCompilerOptions(&options, sizeof(options)); ... fill in those options you care about LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options), &error);

Note that this is also correct, though possibly suboptimal:

LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);

Definition at line 161 of file ExecutionEngineBindings.cpp.

References llvm::EngineBuilder::create(), llvm::TargetOptions::EnableFastISel, F, llvm::EngineKind::JIT, LLVMInitializeMCJITCompilerOptions(), Mod, llvm::EngineBuilder::setCodeModel(), llvm::EngineBuilder::setEngineKind(), llvm::EngineBuilder::setErrorStr(), llvm::EngineBuilder::setMCJITMemoryManager(), llvm::EngineBuilder::setOptLevel(), llvm::EngineBuilder::setTargetOptions(), llvm::unwrap(), and wrap().

◆ LLVMCreateOProfileJITEventListener()

LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener ( void  )

◆ LLVMCreatePerfJITEventListener()

LLVMJITEventListenerRef LLVMCreatePerfJITEventListener ( void  )

◆ LLVMCreateSimpleMCJITMemoryManager()

LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager ( void *  Opaque,
LLVMMemoryManagerAllocateCodeSectionCallback  AllocateCodeSection,
LLVMMemoryManagerAllocateDataSectionCallback  AllocateDataSection,
LLVMMemoryManagerFinalizeMemoryCallback  FinalizeMemory,
LLVMMemoryManagerDestroyCallback  Destroy 
)

Create a simple custom MCJIT memory manager.

This memory manager can intercept allocations in a module-oblivious way. This will return NULL if any of the passed functions are NULL.

Parameters
OpaqueAn opaque client object to pass back to the callbacks.
AllocateCodeSectionAllocate a block of memory for executable code.
AllocateDataSectionAllocate a block of memory for data.
FinalizeMemorySet page permissions and flush cache. Return 0 on success, 1 on error.

Definition at line 403 of file ExecutionEngineBindings.cpp.

References functions, and wrap().

◆ LLVMDisposeExecutionEngine()

void LLVMDisposeExecutionEngine ( LLVMExecutionEngineRef  EE)

Definition at line 216 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMDisposeGenericValue()

void LLVMDisposeGenericValue ( LLVMGenericValueRef  GenVal)

Definition at line 98 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMDisposeMCJITMemoryManager()

void LLVMDisposeMCJITMemoryManager ( LLVMMCJITMemoryManagerRef  MM)

Definition at line 422 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMExecutionEngineGetErrMsg()

LLVMBool LLVMExecutionEngineGetErrMsg ( LLVMExecutionEngineRef  EE,
char **  OutError 
)

Returns true on error, false on success.

If true is returned then the error message is copied to OutStr and cleared in the ExecutionEngine instance.

Definition at line 311 of file ExecutionEngineBindings.cpp.

References assert(), and llvm::unwrap().

◆ LLVMFindFunction()

LLVMBool LLVMFindFunction ( LLVMExecutionEngineRef  EE,
const char Name,
LLVMValueRef OutFn 
)

Definition at line 269 of file ExecutionEngineBindings.cpp.

References F, Name, llvm::unwrap(), and wrap().

◆ LLVMFreeMachineCodeForFunction()

void LLVMFreeMachineCodeForFunction ( LLVMExecutionEngineRef  EE,
LLVMValueRef  F 
)

Definition at line 254 of file ExecutionEngineBindings.cpp.

◆ LLVMGenericValueIntWidth()

unsigned LLVMGenericValueIntWidth ( LLVMGenericValueRef  GenValRef)

Definition at line 70 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMGenericValueToFloat()

double LLVMGenericValueToFloat ( LLVMTypeRef  TyRef,
LLVMGenericValueRef  GenVal 
)

◆ LLVMGenericValueToInt()

unsigned long long LLVMGenericValueToInt ( LLVMGenericValueRef  GenVal,
LLVMBool  IsSigned 
)

◆ LLVMGenericValueToPointer()

void * LLVMGenericValueToPointer ( LLVMGenericValueRef  GenVal)

Definition at line 83 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMGetExecutionEngineTargetData()

LLVMTargetDataRef LLVMGetExecutionEngineTargetData ( LLVMExecutionEngineRef  EE)

Definition at line 283 of file ExecutionEngineBindings.cpp.

References llvm::unwrap(), and wrap().

◆ LLVMGetExecutionEngineTargetMachine()

LLVMTargetMachineRef LLVMGetExecutionEngineTargetMachine ( LLVMExecutionEngineRef  EE)

Definition at line 288 of file ExecutionEngineBindings.cpp.

References llvm::unwrap(), and wrap().

◆ LLVMGetFunctionAddress()

uint64_t LLVMGetFunctionAddress ( LLVMExecutionEngineRef  EE,
const char Name 
)

Definition at line 307 of file ExecutionEngineBindings.cpp.

References Name, and llvm::unwrap().

◆ LLVMGetGlobalValueAddress()

uint64_t LLVMGetGlobalValueAddress ( LLVMExecutionEngineRef  EE,
const char Name 
)

Definition at line 303 of file ExecutionEngineBindings.cpp.

References Name, and llvm::unwrap().

◆ LLVMGetPointerToGlobal()

void * LLVMGetPointerToGlobal ( LLVMExecutionEngineRef  EE,
LLVMValueRef  Global 
)

Definition at line 297 of file ExecutionEngineBindings.cpp.

References llvm::Global, and llvm::unwrap().

◆ LLVMInitializeMCJITCompilerOptions()

void LLVMInitializeMCJITCompilerOptions ( struct LLVMMCJITCompilerOptions Options,
size_t  SizeOfOptions 
)

Definition at line 151 of file ExecutionEngineBindings.cpp.

References LLVMCodeModelJITDefault.

Referenced by LLVMCreateMCJITCompilerForModule().

◆ LLVMLinkInInterpreter()

void LLVMLinkInInterpreter ( void  )

Definition at line 30 of file Interpreter.cpp.

◆ LLVMLinkInMCJIT()

void LLVMLinkInMCJIT ( void  )

Definition at line 41 of file MCJIT.cpp.

◆ LLVMRecompileAndRelinkFunction()

void * LLVMRecompileAndRelinkFunction ( LLVMExecutionEngineRef  EE,
LLVMValueRef  Fn 
)

Definition at line 278 of file ExecutionEngineBindings.cpp.

◆ LLVMRemoveModule()

LLVMBool LLVMRemoveModule ( LLVMExecutionEngineRef  EE,
LLVMModuleRef  M,
LLVMModuleRef OutMod,
char **  OutError 
)

Definition at line 261 of file ExecutionEngineBindings.cpp.

References Mod, llvm::unwrap(), and wrap().

◆ LLVMRunFunction()

LLVMGenericValueRef LLVMRunFunction ( LLVMExecutionEngineRef  EE,
LLVMValueRef  F,
unsigned  NumArgs,
LLVMGenericValueRef Args 
)

Definition at line 239 of file ExecutionEngineBindings.cpp.

References F, I, llvm::unwrap(), and wrap().

◆ LLVMRunFunctionAsMain()

int LLVMRunFunctionAsMain ( LLVMExecutionEngineRef  EE,
LLVMValueRef  F,
unsigned  ArgC,
const char *const ArgV,
const char *const EnvP 
)

Definition at line 230 of file ExecutionEngineBindings.cpp.

References F, and llvm::unwrap().

◆ LLVMRunStaticConstructors()

void LLVMRunStaticConstructors ( LLVMExecutionEngineRef  EE)

Definition at line 220 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMRunStaticDestructors()

void LLVMRunStaticDestructors ( LLVMExecutionEngineRef  EE)

Definition at line 225 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().