search for: llvmgenericvalueref

Displaying 9 results from an estimated 9 matches for "llvmgenericvalueref".

2012 Apr 25
2
[LLVMdev] Crash in JIT
...ol result = LLVMCreateExecutionEngineForModule(&jit, module, &err); LLVMBool result = LLVMCreateJITCompilerForModule(&jit, module, 0, &err); if (result) { printf("Fail: %s\n", err); return -1; } printf("JIT is %p\n", jit); LLVMGenericValueRef argM = LLVMCreateGenericValueOfInt(int32, 10, 0); LLVMGenericValueRef argX = LLVMCreateGenericValueOfInt(int32, 5, 0); LLVMGenericValueRef argB = LLVMCreateGenericValueOfInt(int32, 1, 0); LLVMGenericValueRef args[] = {argM, argX, argB}; LLVMGenericValueRef result2 = LLVMRun...
2017 Jan 25
2
mcjit C interface problems
...stderr, "error: %s\n", error); LLVMDisposeMessage(error); exit(EXIT_FAILURE); } if (argc < 3) { fprintf(stderr, "usage: %s x y\n", argv[0]); exit(EXIT_FAILURE); } long long x = strtoll(argv[1], NULL, 10); long long y = strtoll(argv[2], NULL, 10); LLVMGenericValueRef args[] = {LLVMCreateGenericValueOfInt(LLVMInt32Type(), x, 0), LLVMCreateGenericValueOfInt(LLVMInt32Type(), y, 0)}; printf("args[0]: %d\n", (int)LLVMGenericValueToInt(args[0], 0)); printf("args[1]: %d\n", (int)LLVMGenericValueToInt(args[1], 0)); LLVMGenericValueRef res =...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...MBool result = LLVMCreateExecutionEngineForModule(&jit, module, &err); LLVMBool result = LLVMCreateJITCompilerForModule(&jit, module, 0, &err); if (result) { printf("Fail: %s\n", err); return -1; } printf("JIT is %p\n", jit); LLVMGenericValueRef argM = LLVMCreateGenericValueOfInt(int32, 10, 0); LLVMGenericValueRef argX = LLVMCreateGenericValueOfInt(int32, 5, 0); LLVMGenericValueRef argB = LLVMCreateGenericValueOfInt(int32, 1, 0); LLVMGenericValueRef args[] = {argM, argX, argB}; LLVMGenericValueRef result2 = LLVMRunFunctio...
2017 Jan 26
2
mcjit C interface problems
...n Wed, Jan 25, 2017 at 5:20 PM, Andres Freund <andres at anarazel.de> wrote: > Hi, > > On 2017-01-25 15:17:04 -0800, Toshiyasu Morita via llvm-dev wrote: > > long long x = strtoll(argv[1], NULL, 10); > > long long y = strtoll(argv[2], NULL, 10); > > > > LLVMGenericValueRef args[] = > > {LLVMCreateGenericValueOfInt(LLVMInt32Type(), x, 0), > > > > LLVMCreateGenericValueOfInt(LLVMInt32Type(), y, 0)}; > > > > printf("args[0]: %d\n", (int)LLVMGenericValueToInt(args[0], 0)); > > printf("args[1]: %d\n", (int)LLVMGe...
2010 Oct 25
0
[LLVMdev] Ocaml bindings for execution engines
...e 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 = LLVMRunFunction(EE, F, NumArgs, GVArgs); free(GVArgs); r...
2015 Jan 08
2
[LLVMdev] JIT simple module and accessing the value fails
...he llvm-c API and want to use the JIT. I've created the following module ; ModuleID = '_tmp' @a = global i64 5 define i64 @__tempfunc() { entry: %a_val = load i64* @a ret i64 %a_val } This output is generated by LLVMDumpModule just before I call LLVMRunFunction. Which yields a LLVMGenericValueRef. However converting the result to a 64bit integer via LLVMGenericValueToInt(gv, true), it results in 360287970189639680 or something similar - not 5. Converting via LLVMGenericValueToInt(gv, false) didn't help either. How can I use global variables in a JIT situation? Is anything wrong with...
2008 Sep 12
1
[LLVMdev] [PATCH] Link in codegen components in llvm-c
...========================= --- include/llvm-c/ExecutionEngine.h (revision 56175) +++ include/llvm-c/ExecutionEngine.h (working copy) @@ -24,6 +24,7 @@ #ifdef __cplusplus extern "C" { +#include "llvm/LinkAllCodegenComponents.h" #endif typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; Cheers, Jonathan
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...L; LLVMExecutionEngineRef engine; LLVMModuleRef module = LLVMModuleCreateWithName("MyModule"); LLVMValueRef toCall = d(module); LLVMDumpModule(module); LLVMLinkInInterpreter(); LLVMCreateInterpreterForModule(&engine, module, &error); LLVMGenericValueRef result = LLVMRunFunction(engine, toCall, 0, NULL); LLVMDisposeModule(module); [pool drain]; return 0; } Thank you, Filip -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100812/388c33da/att...
2010 Aug 12
0
[LLVMdev] LLVM-C: Calling functions contained in other libraries
On Aug 12, 2010, at 10:43 AM, F van der Meeren wrote: > Where am I going wrong here? > Did you link against the library that contains the function? -eric