search for: addmoduleprovider

Displaying 15 results from an estimated 15 matches for "addmoduleprovider".

2008 Jan 15
1
[LLVMdev] Calling between modules
...; development environment, and then calling functions in one module from another module. Is this possible? Basically, I want self contained chunks of code with dependencies on functions in other self contained chunks that get resolved at JIT time. I figured since the ExecutionEngine has an "addModuleProvider" function, this sort of behavior is supported. If not, what is addModuleProvider's intended use? When I can get LLVM to do what I want, it is truly incredible! Thanks for a great project! Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://l...
2008 Jan 15
0
[LLVMdev] Calling between modules
...ting calls to the function in module A. I use new llvm::Function(type, llvm::Function::ExternalLinkage, "myLinkedFunction", moduleB) when I am defining the function with its body in module B. I then have an ExecutionEngine which I constructed with an empty dummy module so that I can use addModuleProvider and removeModuleProvider to link arbitrary modules later. I call addModuleProvider with module A and module B wrapped in ExistingModuleProviders, and call getPointerToFunction. Any ideas? If there isn't anything obviously wrong here, I can boil this down to a snippet that reproduces the probl...
2010 Jan 09
4
[LLVMdev] Using a function from another module
...2) Create moduleB with "func()" 3) execEng = ExecutionEngine::create( new ExistingModuleProvider(moduleB)); 4) execute "func()" (this works fine) 4) add "func()" to moduleA as a declaration (no code blocks) with External linkage. 5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); 6) run a function in moduleA that calls "func()" I get: LLVM ERROR: Program used external function 'func' which could not be resolved! I'm guessing I'm either going about this wrong or missing something. Can anyone offer me som...
2010 Jan 10
0
[LLVMdev] Using a function from another module
...t;func()" > 3) execEng = ExecutionEngine::create( > new ExistingModuleProvider(moduleB)); > 4) execute "func()" (this works fine) > 4) add "func()" to moduleA as a declaration (no code blocks) with External > linkage. > 5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); > 6) run a function in moduleA that calls "func()" > > I get: > LLVM ERROR: Program used external function 'func' which could not be resolved! > > I'm guessing I'm either going about this wrong or missing someth...
2008 Feb 28
1
[LLVMdev] Are multiple execution engines allowed?
...#39;m doing something along the lines of: Module *emptyModule = new Module("emptyModule"); ExecutionEngine executionEngine = ExecutionEngine::create(emptyModule); ExistingModuleProvider moduleProvider = new ExistingModuleProvider(module from disk); executionEngine->addModuleProvider(); ////tests executionEngine->removeModuleProvider delete executionEngine ExecutionEngine executionEngine = ExecutionEngine::create(emptyModule); ExistingModuleProvider moduleProvider = new ExistingModuleProvider(module from disk); exe...
2010 Jan 10
2
[LLVMdev] Using a function from another module
...  3) execEng = ExecutionEngine::create( >>          new ExistingModuleProvider(moduleB)); >>   4) execute "func()" (this works fine) >>   4) add "func()" to moduleA as a declaration (no code blocks) with External >>      linkage. >>   5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); >>   6) run a function in moduleA that calls "func()" >> >> I get: >>   LLVM ERROR: Program used external function 'func' which could not be resolved! >> >> I'm guessing I'm either going about this w...
2006 Nov 28
2
[LLVMdev] question about the LLVM JIT
...ction "int %func() { ret int 5 }" and later > I want this replaced by "int %func() { ret int 10 }". > If I remember correctly this gives a 'function already defined' error > message. I tried to use a seperate module for each call to > ParseAssemblyString + addModuleProvider. > In that way there was a problem with functions calling into other modules. > (which perhaps I could try to solve if would understand addGlobalMapping > better) This is somewhat tricky. To replace a function in-place like this, you should actually modify the function in the original...
2010 Feb 03
0
[LLVMdev] Interpreter with multiple modules.
...;> 3) execEng = ExecutionEngine::create( >> new ExistingModuleProvider(moduleB)); >> 4) execute "func()" (this works fine) >> 4) add "func()" to moduleA as a declaration (no code blocks) with External >> linkage. >> 5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); >> 6) run a function in moduleA that calls "func()" >> >> I get: >> LLVM ERROR: Program used external function 'func' which could not be resolved! >> >> I'm guessing I'm either going about this w...
2010 Feb 03
3
[LLVMdev] Interpreter with multiple modules.
On 3 February 2010 14:13, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote: > I have not used the C api or the interpreter, but via JIT one can use > ExecutionEngine::addGlobalMapping(...) after the function decl in the > foreign module. See if there is an equivalent in the C API, which will > probably work for the interpreter given that this method is declared in >
2010 Jan 10
0
[LLVMdev] Using a function from another module
...tionEngine::create( >>> new ExistingModuleProvider(moduleB)); >>> 4) execute "func()" (this works fine) >>> 4) add "func()" to moduleA as a declaration (no code blocks) with External >>> linkage. >>> 5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); >>> 6) run a function in moduleA that calls "func()" >>> >>> I get: >>> LLVM ERROR: Program used external function 'func' which could not be resolved! >>> >>> I'm guessing I'm...
2006 Nov 29
0
[LLVMdev] question about the LLVM JIT
...nc() { ret int 5 }" >> and later I want this replaced by "int %func() { ret int 10 }". >> If I remember correctly this gives a 'function already defined' >> error message. I tried to use a seperate module for each call to >> ParseAssemblyString + addModuleProvider. >> In that way there was a problem with functions calling into other >> modules. (which perhaps I could try to solve if would understand >> addGlobalMapping better) > > This is somewhat tricky. To replace a function in-place like this, > you should actually modify...
2008 Jan 16
0
[LLVMdev] Cross-module function calls (code included)
...odules(); verifyModule(*mainModule, PrintMessageAction); verifyModule(*utilityModule, PrintMessageAction); PassManager PM; PM.add(new PrintModulePass(&llvm::cout)); PM.run(*mainModule); PM.run(*utilityModule); executionEngine = ExecutionEngine::create(mainModule); executionEngine->addModuleProvider(new ExistingModuleProvider(utilityModule)); int (*fp)(); fp = (int (*)()) executionEngine->getPointerToFunction(utilityFunction); printf("%d\n", fp()); fp = (int (*)()) executionEngine->getPointerToFunction(mainFunction); printf("%d\n", fp()); return 0; } void S...
2010 Jan 11
0
[LLVMdev] Using a function from another module
...h "func()" >  3) execEng = ExecutionEngine::create( >         new ExistingModuleProvider(moduleB)); >  4) execute "func()" (this works fine) >  4) add "func()" to moduleA as a declaration (no code blocks) with External >     linkage. >  5) execEng->addModuleProvider(new ExistingModuleProvider(moduleA)); >  6) run a function in moduleA that calls "func()" > > I get: >  LLVM ERROR: Program used external function 'func' which could not be resolved! > > I'm guessing I'm either going about this wrong or missing something....
2009 Mar 09
0
[LLVMdev] Cross-Module Function Calls
...vm::getBitcodeModuleProvider(foo_buffer,&err); bar_buffer = llvm::MemoryBuffer::getFile( "bar.bc", &error ); bar_provider = llvm::getBitcodeModuleProvider(bar_buffer,&err); llvm::ExecutionEngine *engine; engine = llvm::ExecutionEngine::create( foo_provider ); engine->addModuleProvider( bar_provider ); std::vector<std::string> args; args.push_back( "foo.ll" ); llvm::Function *fn_main = engine->FindFunctionNamed( "main" ); int rv = engine->runFunctionAsMain( fn_main, args, environ ); return rv; } //// #### Makefile AS=/home/terrence/programmi...
2008 Jan 04
7
[LLVMdev] Calling functions across modules. And those pesky vectors!
Before I get started with more questions, thanks for the prompt reply on my last set question, that was much appreciated. First, I found references to lazy inling and optimizations for calling functions across modules, but I can't figure out how to do that. If I just take a Function* that I got out of one module and call it from the other, it doesn't work. What's the general