Get count of inlined functions from clang rung

Hello.

Is it possible get count of inlined by clang functions with any clang
command line options? If yes, which options should I set? Thank you.

I'm not aware of a more direct way to do it, but you could count messages:

cat inline.c

int x;
void tiny() { ++x; }
void f() { tiny(); tiny(); tiny(); }

clang -Ofast -Rpass=inline inline.c 2>&1 | grep "inlined into" | wc -l

3

-Troy

I got some workable solution only with '-Rpass=inline |& grep -c
"inlined into"'. If you have anything more elegant - tell me please :slight_smile:

27.08.2018 23:18, Alexander Zaitsev via cfe-dev пишет:

I got some workable solution only with '-Rpass=inline |& grep -c
"inlined into"'. If you have anything more elegant - tell me please :slight_smile:

You can also use -fsave-optimization-record and then process the YAML
records from the inliner.

-Hal