Displaying 2 results from an estimated 2 matches for "add_global_mapping".
2006 Nov 28
2
[LLVMdev] question about the LLVM JIT
...%v2, int* %my_global_int
> ret int %v2
> }'''
>
> def test_modify_global_data():
> llvmjit.restart()
> llvmjit.set_global_data(10)
> assert llvmjit.get_global_data() == 10
> gp_data = llvmjit.get_pointer_to_global_data()
> llvmjit.add_global_mapping('my_global_data', gp_data) #note:
> should be prior to compile()
> llvmjit.compile(llglobalmul4)
> globalmul4 = llvmjit.find_function('globalmul4')
> assert llvmjit.execute(globalmul4, 5) == 10 * 4 + 5
> assert llvmjit.get_global_data() == 10 * 4...
2006 Nov 29
0
[LLVMdev] question about the LLVM JIT
>> <snip>.
>> void add_global_mapping(const char* name, void* address) {
>> GlobalVariable var(Type::IntTy, false,
>> GlobalVariable::ExternalLinkage, 0, name, gp_module);
>> gp_execution_engine->addGlobalMapping(&var, address);
>> }
>
> This is creating a new global variable on the stack,...