diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-04-24 23:33:53 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-04-24 23:33:53 +0000 |
commit | ee1e45796eff17c2d28ceb35372e5ed86b313a89 (patch) | |
tree | 57eb44184b5df55f5931d0fc156e4a3c58889088 /llvm/include/llvm-c/ExecutionEngine.h | |
parent | 46ed4d978e1cfb5da00035142db4e0f1c80e778f (diff) | |
download | bcm5719-llvm-ee1e45796eff17c2d28ceb35372e5ed86b313a89.tar.gz bcm5719-llvm-ee1e45796eff17c2d28ceb35372e5ed86b313a89.zip |
Exposing MCJIT through C API
Patch by Filip Pizlo
llvm-svn: 180229
Diffstat (limited to 'llvm/include/llvm-c/ExecutionEngine.h')
-rw-r--r-- | llvm/include/llvm-c/ExecutionEngine.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h index be763312d22..8b654d5a5ca 100644 --- a/llvm/include/llvm-c/ExecutionEngine.h +++ b/llvm/include/llvm-c/ExecutionEngine.h @@ -34,11 +34,17 @@ extern "C" { */ void LLVMLinkInJIT(void); +void LLVMLinkInMCJIT(void); void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; +struct LLVMMCJITCompilerOptions { + unsigned OptLevel; + LLVMBool NoFramePointerElim; +}; + /*===-- Operations on generic values --------------------------------------===*/ LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, @@ -75,6 +81,28 @@ LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, unsigned OptLevel, 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, and it is also correct to set any + * field to zero. The canonical way of using this is: + * + * LLVMMCJITCompilerOptions options; + * memset(&options, 0, 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); + */ +LLVMBool LLVMCreateMCJITCompilerForModule(LLVMExecutionEngineRef *OutJIT, + LLVMModuleRef M, + struct LLVMMCJITCompilerOptions *Options, + size_t SizeOfOptions, + char **OutError); + /** Deprecated: Use LLVMCreateExecutionEngineForModule instead. */ LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE, LLVMModuleProviderRef MP, |