LLVM 22.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

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

Detailed Description

Typedef Documentation

◆ LLVMExecutionEngineRef

typedef struct LLVMOpaqueExecutionEngine* LLVMExecutionEngineRef

Definition at line 49 of file ExecutionEngine.h.

◆ LLVMGenericValueRef

typedef struct LLVMOpaqueGenericValue* LLVMGenericValueRef

Definition at line 48 of file ExecutionEngine.h.

◆ LLVMMCJITMemoryManagerRef

typedef struct LLVMOpaqueMCJITMemoryManager* LLVMMCJITMemoryManagerRef

Definition at line 50 of file ExecutionEngine.h.

◆ LLVMMemoryManagerAllocateCodeSectionCallback

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

Definition at line 173 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 176 of file ExecutionEngine.h.

◆ LLVMMemoryManagerDestroyCallback

typedef void(* LLVMMemoryManagerDestroyCallback) (void *Opaque)

Definition at line 181 of file ExecutionEngine.h.

◆ LLVMMemoryManagerFinalizeMemoryCallback

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

Definition at line 179 of file ExecutionEngine.h.

Function Documentation

◆ LLVMAddGlobalMapping()

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

Definition at line 291 of file ExecutionEngineBindings.cpp.

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

◆ LLVMAddModule()

LLVM_C_ABI void LLVMAddModule ( LLVMExecutionEngineRef  EE,
LLVMModuleRef  M 
)

Definition at line 256 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMCreateExecutionEngineForModule()

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

◆ LLVMCreateGDBRegistrationListener()

LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener ( void  )

◆ LLVMCreateGenericValueOfFloat()

LLVM_C_ABI LLVMGenericValueRef LLVMCreateGenericValueOfFloat ( LLVMTypeRef  Ty,
double  N 
)

◆ LLVMCreateGenericValueOfInt()

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

Definition at line 40 of file ExecutionEngineBindings.cpp.

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

◆ LLVMCreateGenericValueOfPointer()

LLVM_C_ABI LLVMGenericValueRef LLVMCreateGenericValueOfPointer ( void *  P)

Definition at line 48 of file ExecutionEngineBindings.cpp.

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

◆ LLVMCreateIntelJITEventListener()

LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateIntelJITEventListener ( void  )

◆ LLVMCreateInterpreterForModule()

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

◆ LLVMCreateJITCompilerForModule()

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

◆ LLVMCreateMCJITCompilerForModule()

LLVM_C_ABI 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 160 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()

LLVM_C_ABI LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener ( void  )

◆ LLVMCreatePerfJITEventListener()

LLVM_C_ABI LLVMJITEventListenerRef LLVMCreatePerfJITEventListener ( void  )

◆ LLVMCreateSimpleMCJITMemoryManager()

LLVM_C_ABI 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 402 of file ExecutionEngineBindings.cpp.

References functions, and wrap().

◆ LLVMDisposeExecutionEngine()

LLVM_C_ABI void LLVMDisposeExecutionEngine ( LLVMExecutionEngineRef  EE)

Definition at line 215 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMDisposeGenericValue()

LLVM_C_ABI void LLVMDisposeGenericValue ( LLVMGenericValueRef  GenVal)

Definition at line 97 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMDisposeMCJITMemoryManager()

LLVM_C_ABI void LLVMDisposeMCJITMemoryManager ( LLVMMCJITMemoryManagerRef  MM)

Definition at line 421 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMExecutionEngineGetErrMsg()

LLVM_C_ABI 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 310 of file ExecutionEngineBindings.cpp.

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

◆ LLVMFindFunction()

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

Definition at line 268 of file ExecutionEngineBindings.cpp.

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

◆ LLVMFreeMachineCodeForFunction()

LLVM_C_ABI void LLVMFreeMachineCodeForFunction ( LLVMExecutionEngineRef  EE,
LLVMValueRef  F 
)

Definition at line 253 of file ExecutionEngineBindings.cpp.

◆ LLVMGenericValueIntWidth()

LLVM_C_ABI unsigned LLVMGenericValueIntWidth ( LLVMGenericValueRef  GenValRef)

Definition at line 69 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMGenericValueToFloat()

LLVM_C_ABI double LLVMGenericValueToFloat ( LLVMTypeRef  TyRef,
LLVMGenericValueRef  GenVal 
)

◆ LLVMGenericValueToInt()

LLVM_C_ABI unsigned long long LLVMGenericValueToInt ( LLVMGenericValueRef  GenVal,
LLVMBool  IsSigned 
)

◆ LLVMGenericValueToPointer()

LLVM_C_ABI void * LLVMGenericValueToPointer ( LLVMGenericValueRef  GenVal)

Definition at line 82 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMGetExecutionEngineTargetData()

LLVM_C_ABI LLVMTargetDataRef LLVMGetExecutionEngineTargetData ( LLVMExecutionEngineRef  EE)

Definition at line 282 of file ExecutionEngineBindings.cpp.

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

◆ LLVMGetExecutionEngineTargetMachine()

LLVM_C_ABI LLVMTargetMachineRef LLVMGetExecutionEngineTargetMachine ( LLVMExecutionEngineRef  EE)

Definition at line 287 of file ExecutionEngineBindings.cpp.

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

◆ LLVMGetFunctionAddress()

LLVM_C_ABI uint64_t LLVMGetFunctionAddress ( LLVMExecutionEngineRef  EE,
const char Name 
)

Definition at line 306 of file ExecutionEngineBindings.cpp.

References Name, and llvm::unwrap().

◆ LLVMGetGlobalValueAddress()

LLVM_C_ABI uint64_t LLVMGetGlobalValueAddress ( LLVMExecutionEngineRef  EE,
const char Name 
)

Definition at line 302 of file ExecutionEngineBindings.cpp.

References Name, and llvm::unwrap().

◆ LLVMGetPointerToGlobal()

LLVM_C_ABI void * LLVMGetPointerToGlobal ( LLVMExecutionEngineRef  EE,
LLVMValueRef  Global 
)

Definition at line 296 of file ExecutionEngineBindings.cpp.

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

◆ LLVMInitializeMCJITCompilerOptions()

LLVM_C_ABI void LLVMInitializeMCJITCompilerOptions ( struct LLVMMCJITCompilerOptions Options,
size_t  SizeOfOptions 
)

Definition at line 150 of file ExecutionEngineBindings.cpp.

References LLVMCodeModelJITDefault.

Referenced by LLVMCreateMCJITCompilerForModule().

◆ LLVMLinkInInterpreter()

LLVM_C_ABI void LLVMLinkInInterpreter ( void  )

Empty function used to force the linker to link the LLVM interpreter.

Has no effect when called on a pre-built library (dylib interface).

Definition at line 30 of file Interpreter.cpp.

◆ LLVMLinkInMCJIT()

LLVM_C_ABI void LLVMLinkInMCJIT ( void  )

Empty function used to force the linker to link MCJIT.

Has no effect when called on a pre-built library (dylib interface).

Definition at line 40 of file MCJIT.cpp.

◆ LLVMRecompileAndRelinkFunction()

LLVM_C_ABI void * LLVMRecompileAndRelinkFunction ( LLVMExecutionEngineRef  EE,
LLVMValueRef  Fn 
)

Definition at line 277 of file ExecutionEngineBindings.cpp.

◆ LLVMRemoveModule()

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

Definition at line 260 of file ExecutionEngineBindings.cpp.

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

◆ LLVMRunFunction()

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

Definition at line 238 of file ExecutionEngineBindings.cpp.

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

◆ LLVMRunFunctionAsMain()

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

Definition at line 229 of file ExecutionEngineBindings.cpp.

References F, and llvm::unwrap().

◆ LLVMRunStaticConstructors()

LLVM_C_ABI void LLVMRunStaticConstructors ( LLVMExecutionEngineRef  EE)

Definition at line 219 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().

◆ LLVMRunStaticDestructors()

LLVM_C_ABI void LLVMRunStaticDestructors ( LLVMExecutionEngineRef  EE)

Definition at line 224 of file ExecutionEngineBindings.cpp.

References llvm::unwrap().