[cfe-users] Inline Clang functions

Dmitri Gribenko gribozavr at gmail.com
Wed Jan 1 05:03:55 PST 2014


On Tue, Dec 31, 2013 at 3:48 AM, Saoni Mukherjee
<sayani.mookherjee at gmail.com> wrote:
> However if I print the AST of the program (clang -cc1 ast-dump program.c),
> it shows two functions, NOT the add inlined into main. Am I missing
> something?

Hello,

AST printer prints the AST as source code as closely to source as
possible.  Even more, Clang does not perform inlining on AST level, it
is performed on LLVM IR.

Also, please note that 'inline' is only an advice for the compiler,
not a hard requirement.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-users mailing list