Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does clang support "-fprofile-generate" and "-fprofile-use"?

Tags:

c++

profile

clang

I am using 3.5 and it doesn't seem to be in there... Am I missing something?

For example, with GCC I can compile a program like this:

gcc -fprofile-generate main.cpp

...then I run the program, and after it exits (gracefully) it will generate a set of files (extensions are .gcda I think). These files contain branching results that can be used to do profile-based optimization like this:

gcc -fprofile-use main.cpp

Is there a similar feature in Clang that I have overlooked?

Thanks!

like image 233
Badmanchild Avatar asked Sep 12 '25 07:09

Badmanchild


1 Answers

Profiling with Instrumentation section of Clang manual mentions the flags -fprofile-instr-generate and -fprofile-instr-use with almost the same meaning.

like image 98
Anton Savin Avatar answered Sep 14 '25 23:09

Anton Savin