[LLVMdev] Removing inlining of library functions

Cristina Cifuentes Cristina.Cifuentes at sun.com
Wed Feb 20 18:55:09 PST 2008


I am interested in analyzing the bytecode code produced for C files.   
By default, inlining of user and library functions (libc) is done. If  
I turn off inlining (-disable-inlining in gccas and gccld) then no  
inlining is done.  I want to be able to inline user code but disallow   
library code to be inlined.

In trying to understand the InlineSimple.cpp code, I see that library  
functions are tagged as having internal linkage, just as other user  
functions in a module, and so these library functions are inlined if  
they satisfy other inlining rules (e.g., strcpy() is quite often  
inlined).

My questions:
- is there a simple way to disallow inlining of library functions?
- in what part of the code tree is the internal linkage attribute  
being set for library functions?

I am using LLVM1.9 (due to a dependency of some C code on gcc3.4) but  
I'd imagine that this functionality hasn't changed much in more recent  
versions.

Thanks,
Cristina







More information about the llvm-dev mailing list