llvm.org GIT mirror llvm / c13c4d6
Fix the LLVMCreateJITCompiler C binding. Evan broke it in r54523 by adding a parameter in the implementation without updating the header correspondingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54555 91177308-0d34-0410-b5e6-96231b3b80d8 Gordon Henriksen 12 years ago
5 changed file(s) with 29 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
180180 llvm_ee_create_jit(LLVMModuleProviderRef MP) {
181181 LLVMExecutionEngineRef JIT;
182182 char *Error;
183 if (LLVMCreateJITCompiler(&JIT, MP, &Error))
183 if (LLVMCreateJITCompiler(&JIT, MP, 0, &Error))
184 llvm_raise(llvm_ee_error_exn, Error);
185 return JIT;
186 }
187
188 /* llmoduleprovider -> ExecutionEngine.t */
189 CAMLprim LLVMExecutionEngineRef
190 llvm_ee_create_fast_jit(LLVMModuleProviderRef MP) {
191 LLVMExecutionEngineRef JIT;
192 char *Error;
193 if (LLVMCreateJITCompiler(&JIT, MP, 1, &Error))
184194 llvm_raise(llvm_ee_error_exn, Error);
185195 return JIT;
186196 }
6161 = "llvm_ee_create_interpreter"
6262 external create_jit: Llvm.llmoduleprovider -> t
6363 = "llvm_ee_create_jit"
64 external create_fast_jit: Llvm.llmoduleprovider -> t
65 = "llvm_ee_create_fast_jit"
6466 external dispose: t -> unit
6567 = "llvm_ee_dispose"
6668 external add_module_provider: Llvm.llmoduleprovider -> t -> unit
9999 val create_interpreter: Llvm.llmoduleprovider -> t
100100
101101 (** [create_jit mp] creates a new JIT (just-in-time compiler), taking
102 ownership of the module provider [mp] if successful. Raises [Error msg] if
103 an error occurrs. The execution engine is not garbage collected and must
104 be destroyed with [dispose ee].
102 ownership of the module provider [mp] if successful. This function creates
103 a JIT which favors code quality over compilation speed. Raises [Error msg]
104 if an error occurrs. The execution engine is not garbage collected and
105 must be destroyed with [dispose ee].
105106 See the function [llvm::ExecutionEngine::create]. *)
106107 val create_jit: Llvm.llmoduleprovider -> t
108
109 (** [create_fast_jit mp] creates a new JIT (just-in-time compiler) which
110 favors compilation speed over code quality. It takes ownership of the
111 module provider [mp] if successful. Raises [Error msg] if an error
112 occurrs. The execution engine is not garbage collected and must be
113 destroyed with [dispose ee].
114 See the function [llvm::ExecutionEngine::create]. *)
115 val create_fast_jit: Llvm.llmoduleprovider -> t
107116
108117 (** [dispose ee] releases the memory used by the execution engine and must be
109118 invoked to avoid memory leaks. *)
6161
6262 int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
6363 LLVMModuleProviderRef MP,
64 int Fast,
6465 char **OutError);
6566
6667 void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
113113
114114 int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
115115 LLVMModuleProviderRef MP,
116 char **OutError,
117 bool Fast = false) {
116 int Fast,
117 char **OutError) {
118118 std::string Error;
119119 if (ExecutionEngine *JIT = ExecutionEngine::createJIT(unwrap(MP), &Error, 0,
120 Fast)) {
120 Fast != 0)) {
121121 *OutJIT = wrap(JIT);
122122 return 0;
123123 }