[LLVMdev] inline callsites whose function definitions are in different file?
czhao at eecg.toronto.edu
Tue Jul 27 10:00:32 PDT 2010
On 7/27/2010 12:53 PM, Devang Patel wrote:
> 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.
>> - 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 ?
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Ya, I agree with you. The answer is, do such types of inlining at link time.
More information about the llvm-dev