Including libraries into bc files

Hello there,

I’m working with some transformations on llvm IR right now, and, in some cases, I should be able to insert calls for functions that are not defined on the same module being compiled, but somewhere else. I know the path to all libraries I need, and I’m currently adding includes directives manually on C++ files before compiling them. Therefore, it should be more interesting if I could add those missing includes automatically. So, is there a way I could do that on LLVM?

PS: I’m guessing it should be possible to create a pass for LLVM that just added the IR of the functions I need directly to the module being processed, but I think probably there is a more (let’s say) elegant way to do that.

Thanks in advance,