One or many modules with the JIT?


I'm at the beginning stages of building a language that uses the JIT,
and works like a scripting language in that you run the source files
without explicit compilation. I'd like to start using modules in the
source language. Usually a module will correspond to a file. I'm
wondering if I should also use separate LLVM modules, or keep
compiling everything to the single module associated with the JIT
engine. I see an `addModule' function in the engine, but I don't
know what it does. Does that take care of linking? If that allows
me to use separate LLVM modules, is there an advantage of doing it
that way?


If you're planning on making your own interpreter and module data
structures, I'd say it's easiest to use a single module for all
machine code you end up generating. No reason to complicate things by
tracking different LLVM modules if you don't have to.