[llvm-dev] LLVM IR linking separate function definitions in header files in single IR
Mehdi AMINI via llvm-dev
llvm-dev at lists.llvm.org
Thu Jan 3 15:21:48 PST 2019
On Tue, Jan 1, 2019 at 1:41 PM hameeza ahmed via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I have different codes with separate files with functions implemented. I
> want to view all function definitions/ instructions in single IR. I am able
> to do this by llvm-link for codes which have definition implemented in .c
> But there are some codes which have definitions instructions in header
> files. These functions are called from .c file. I want to have a single IR
> with all the definitions of the called functions that are implemented in
> header files..
> How to do this?
> Please help...
I assume that your "function defined in a header" are marked as inline?
There is no semantic concept of "header" in C/C++: moving code from a .c to
a .h (or renaming a file) does not change anything to what the compiler
will do with it.
Depending on the language (GNU-C89, C99 vs C++, see here:
https://en.wikipedia.org/wiki/Inline_function ), the semantic of inline
functions is different.
If you can provide an minimal example it would be easier.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev