[LLVMdev] Importing existing function declarations into LLVM C++ API

Dan Bailey dan at dneg.com
Tue Apr 3 05:10:00 PDT 2012


Hi,

This is a tricky problem to search for on the llvmdev list as all the 
ways I can think of describing this seem to use pretty common keywords, 
so this may have been asked before.

I'm looking for a way of importing or including existing function 
declarations or global variables into LLVM IR that I'm building manually 
using the API. These declarations are written in C++, so I guess there 
are two possible ways of doing this, either parsing and importing them 
using the Clang API (though I'm not particularly familiar with this) or 
compiling them to IR externally without running any optimisation passes 
and importing them from .ll files? Or maybe produce two separate modules 
and merge them?

Is there anything in the codebase or the documentation that someone 
could point me to? Or any suggestions on how better to tackle this would 
be appreciated?

Thanks,
Dan



More information about the llvm-dev mailing list