[LLVMdev] inline callsites whose function definitions are in different file?

Devang Patel devang.patel at gmail.com
Tue Jul 27 09:53:11 PDT 2010

On Tue, Jul 27, 2010 at 9:46 AM, Chuck Zhao <czhao at eecg.toronto.edu> wrote:

> I don't, and the compiler doesn't neither, that is the problem, unless I do
> hacking at compile time.
> E.g.:
> - put all such function's definitions into file1.c
> - force to compile file1.c 1st.
> - when compiling file2.c:
>  . read file1.bc
>  . attach to file2's module
>  - do inline analysis + inlining
>  - detach the attached file1.bc functions
> - repeat for other files.
> ...

This is what LTO does.

One difference is, usually LTO stitches all modules together before
inlining instead of individually attaching/detaching .bc files. This
is because what if file2.c uses a function from file9.c ?


More information about the llvm-dev mailing list