Displaying 13 results from an estimated 13 matches for "llvmexecutionengineref".
2017 Mar 09
2
LLVMGetBitcodeModuleInContext2 problem
...mParser();
Now it crashes in LLVMGetFunctionAddress().
Hmm.
On Wed, Mar 8, 2017 at 5:14 PM, Toshiyasu Morita <toshi at tensyr.com> wrote:
> Made it a bit further. Here's the current code:
>
> void llvm_load_IR_library(char *path)
> {
> char *error;
> LLVMExecutionEngineRef engine;
> object0_t* (*func)(void), *output;
> LLVMContextRef global_context;
> LLVMMemoryBufferRef module;
> LLVMModuleRef ir_lib_module;
> bool flag;
>
> printf("loading IR library from path: %s\n", path);
>
>...
2014 Apr 04
2
[LLVMdev] Weird problems on calling an external function from MCJIT on Windows(mingw)
...= 0;
LLVMModuleRef m = 0;
LLVMCreateMemoryBufferWithContentsOfFile("test_load_lib.ll",&ll_f,&err);
//read .ll
prt(err);
LLVMParseIRInContext(LLVMGetGlobalContext(),ll_f,&m,&err); // ll_f doesnt
need freeing
prt(err);
LLVMDumpModule(m);
LLVMLinkInMCJIT();
LLVMExecutionEngineRef ee = 0;
LLVMCreateMCJITCompilerForModule(&ee,m,0,0,&err);
prt(err);
using tf_t = int ();
tf_t *f =
(tf_t*)LLVMGetPointerToGlobal(ee,LLVMGetNamedFunction(m,"test_func"));
At first i got "LLVM ERROR: Incompatible object format! "
But by reading some articles I app...
2014 Apr 04
2
[LLVMdev] Weird problems on calling an external function from MCJIT on Windows(mingw)
...l",&ll_f,&err);
> > //read .ll
> > prt(err);
> > LLVMParseIRInContext(LLVMGetGlobalContext(),ll_f,&m,&err); // ll_f
> doesnt
> > need freeing
> > prt(err);
> > LLVMDumpModule(m);
> >
> > LLVMLinkInMCJIT();
> > LLVMExecutionEngineRef ee = 0;
> > LLVMCreateMCJITCompilerForModule(&ee,m,0,0,&err);
> > prt(err);
> > using tf_t = int ();
> > tf_t *f =
> > (tf_t*)LLVMGetPointerToGlobal(ee,LLVMGetNamedFunction(m,"test_func"));
> >
> > At first i got "LLVM ERROR:...
2017 Mar 08
2
LLVMGetBitcodeModuleInContext2 problem
Or do you mean I need to load the module into memory before calling
LLVMGetBitcodeModuleInContext2?
> Yes, you need to load the module into memory first.
> LLVMCreateMemoryBufferWithContentsOfFile will do that for you.
Thanks!
On Wed, Mar 8, 2017 at 3:48 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:
> On 3/8/2017 3:44 PM, Toshiyasu Morita wrote:
>
>
>>
2014 Apr 04
2
[LLVMdev] Weird problems on calling an external function from MCJIT on Windows(mingw)
...>> > LLVMParseIRInContext(LLVMGetGlobalContext(),ll_f,&m,&err); // ll_f
> >> > doesnt
> >> > need freeing
> >> > prt(err);
> >> > LLVMDumpModule(m);
> >> >
> >> > LLVMLinkInMCJIT();
> >> > LLVMExecutionEngineRef ee = 0;
> >> > LLVMCreateMCJITCompilerForModule(&ee,m,0,0,&err);
> >> > prt(err);
> >> > using tf_t = int ();
> >> > tf_t *f =
> >> > (tf_t*)LLVMGetPointerToGlobal(ee,LLVMGetNamedFunction(m,"test_func"));
> >...
2012 Apr 25
2
[LLVMdev] Crash in JIT
...uot;);
LLVMValueRef retInst;
retInst = LLVMBuildRet(builder, y);
(void) retInst;
LLVMDisposeBuilder(builder);
LLVMLinkInJIT();
LLVMLinkInInterpreter();
LLVMInitializeNativeTarget();
LLVMDumpModule(module);
/* Now run it! */
LLVMExecutionEngineRef jit = NULL;
char *err;
// LLVMBool result = LLVMCreateExecutionEngineForModule(&jit, module, &err);
LLVMBool result = LLVMCreateJITCompilerForModule(&jit, module, 0, &err);
if (result) {
printf("Fail: %s\n", err);
return -1;
}
printf(...
2010 May 11
1
[LLVMdev] LLVMGetPointerToFunction
Hi,
Is there such a function (or a similar one) which is callable using the
c-binding llvm?
Many thanks,
Georg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100511/d49c75d2/attachment.html>
2010 Oct 25
0
[LLVMdev] Ocaml bindings for execution engines
Hi All,
Here is the code from bindings/ocam/executionengine/executionengine_ocaml.c.
/* llvalue -> GenericValue.t array -> ExecutionEngine.t -> GenericValue.t */
CAMLprim value llvm_ee_run_function(LLVMValueRef F, value Args,
LLVMExecutionEngineRef EE) {
unsigned NumArgs;
LLVMGenericValueRef Result, *GVArgs;
unsigned I;
NumArgs = Wosize_val(Args);
GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueRef));
for (I = 0; I != NumArgs; ++I)
GVArgs[I] = Genericvalue_val(Field(Args, I));
Result = LLVMRunFuncti...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...mx, bParam, "y");
LLVMValueRef retInst;
retInst = LLVMBuildRet(builder, y);
(void) retInst;
LLVMDisposeBuilder(builder);
LLVMLinkInJIT();
LLVMLinkInInterpreter();
LLVMInitializeNativeTarget();
LLVMDumpModule(module);
/* Now run it! */
LLVMExecutionEngineRef jit = NULL;
char *err;
// LLVMBool result = LLVMCreateExecutionEngineForModule(&jit, module, &err);
LLVMBool result = LLVMCreateJITCompilerForModule(&jit, module, 0, &err);
if (result) {
printf("Fail: %s\n", err);
return -1;
}
printf(...
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...dCall(builder, fullUsername, NULL, 0, "myCall");
LLVMBuildRet(builder, returnVal);
LLVMDisposeBuilder(builder);
return result;
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
char * error = NULL;
LLVMExecutionEngineRef engine;
LLVMModuleRef module = LLVMModuleCreateWithName("MyModule");
LLVMValueRef toCall = d(module);
LLVMDumpModule(module);
LLVMLinkInInterpreter();
LLVMCreateInterpreterForModule(&engine, module, &error);
LLVMGenericValueRef result =...
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
...ifying Function:\n", moduleName);
LLVMVerifyFunction(vFnMain, LLVMPrintMessageAction);
printf("\n[llvmPrintf# %s] Dumping LLVM generated Code:\n", moduleName);
LLVMDumpModule(modCEx);
// Compile and JIT above generated function:
LLVMInitializeNativeTarget();
LLVMExecutionEngineRef engExe;
char * pErr = NULL;
LLVMCreateJITCompilerForModule(&engExe, modCEx, 4, &pErr);
if (pErr) {
printf("[Creating JIT Compiler] Error: %s\n", pErr);
LLVMDisposeMessage(pErr);
exit(0);
}
LLVMPassManagerRef rPassMgr = LLVMCreatePassMan...
2010 Feb 28
2
[LLVMdev] Tag number of OCaml Variant in executionengine
...s, one
is None represented as unboxed int, the other is Some represented
as a tagged block, and OCaml runtime may only distinguish them
as the structures, but not the tag number.
Zjz
233 /* string -> ExecutionEngine.t -> llvalue option */
234 CAMLprim value llvm_ee_find_function(value Name,
LLVMExecutionEngineRef EE) {
235 CAMLparam1(Name);
236 CAMLlocal1(Option);
237 LLVMValueRef Found;
238 if (LLVMFindFunction(EE, String_val(Name), &Found))
239 CAMLreturn(Val_unit);
240 Option = alloc(1, 1);
241 Field(Option, 0) = Val_op(Found);
242 CAMLreturn(Option);
243 }
2017 Jan 25
2
mcjit C interface problems
...r();
LLVMPositionBuilderAtEnd(builder, entry);
LLVMValueRef tmp = LLVMBuildAdd(builder, LLVMGetParam(sum, 0),
LLVMGetParam(sum, 1), "tmp");
LLVMBuildRet(builder, tmp);
char* error = NULL;
LLVMVerifyModule(mod, LLVMAbortProcessAction, &error);
LLVMDisposeMessage(error);
LLVMExecutionEngineRef engine;
error = NULL;
LLVMLinkInMCJIT();
LLVMInitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
LLVMInitializeNativeAsmParser();
if (LLVMCreateExecutionEngineForModule(&engine, mod, &error) != 0) {
fprintf(stderr, "failed to create execution engine\n");...