Calling between modules

Hello,

I am fairly new to LLVM development. Currently I am trying to treat LLVM modules almost like “.o” files in a “normal” 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

Hi!

I am fairly new to LLVM development.

Welcome!

Currently I am trying to treat LLVM modules almost like ".o" files in a "normal" development environment, and then calling functions in one module from another module. Is this possible?

Yes! In fact, that's close to what modules are in LLVM. If you want to call a function outside of a .o file, then you have an external declaration of that function in the module, and then call it like normal. You link the .o files like normal to create the final executable.