search for: llvmgetfunctionaddress

Displaying 5 results from an estimated 5 matches for "llvmgetfunctionaddress".

2017 Jan 26
2
mcjit C interface problems
...ser: $ ./capi_test 5 6 args[0]: 5 args[1]: 6 result: 4294959200 Here's the code I changed: printf("args[0]: %d\n", (int)LLVMGenericValueToInt(args[0], 0)); printf("args[1]: %d\n", (int)LLVMGenericValueToInt(args[1], 0)); uint64_t (*func)(); func = (uint64_t (*)())LLVMGetFunctionAddress(engine, "sum"); printf("result: %lu\n", (*func)()); Anything else I should look at? Toshi On 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: > >...
2017 Mar 09
2
LLVMGetBitcodeModuleInContext2 problem
Oops, missed initializing some stuff. Added: LLVMLinkInMCJIT(); LLVMInitializeNativeTarget(); LLVMInitializeNativeAsmPrinter(); LLVMInitializeNativeAsmParser(); 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_...
2017 Jan 25
2
mcjit C interface problems
Hi, I'm attempting to use MCJIT with the C interface with llvm-3.9.0, and it doesn't seem to work. This code is derived from Paul Smith's example code: int main(int argc, char const* argv[]) { LLVMModuleRef mod = LLVMModuleCreateWithName("my_module"); LLVMTypeRef param_types[] = {LLVMInt32Type(), LLVMInt32Type()}; LLVMTypeRef ret_type =
2017 Apr 28
2
LLVMGetFirstFunction() / LLVMGetNextFunction( ) problem
...ds main(). 50 first_func = LLVMGetFirstFunction(module); (gdb) next 151 last_func = LLVMGetLastFunction(module); (gdb) 154 for (func = first_func; func != last_func; func = LLVMGetNextFunction(func)) { (gdb) 155 func_name = LLVMGetValueName(func); (gdb) 156 func_addr = LLVMGetFunctionAddress(engine, func_name); (gdb) print func_name $9 = 0x1efe180 "matmul" (gdb) next 159 if (!func_addr) continue; (gdb) 161 symbol_table_add(symbol_table, func_name, func_addr); (gdb) 164 if ((size = mem_region_lookup(mem_region_anchor, func_addr))) { symbol_table_add(symbol...
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: > > >>