(no subject)

Hi all,

I was interested in knowing which of the passes spends the most of the time compiling the dns server BIND.
With the -CC option I selected clang as my compiler and, as I was expecting, the compilation gave me no problems.
Now I have a question, is there any way to set an option similiar to “-time-passes” to clang in order to get those information I was interested in?
Or do you think there is another equivalent way to do that?

Thank you in advance,


To use options like "-time-passes" and "-stats" you need to prefix
them with "-mllvm":

clang -mllvm -time-passes -O3 test.c -o /dev/null

Note that I believe you need asserts enabled or some other build
configuration for this to work,
the timing code is disabled in fully release builds IIRC.

Hope this helps!


I tried it on a simple file test.c (as you did) but actually clang does not show me any output.

In addition I tried to set the CFLAGS specifying the -mllvm -time-passes options. However I still have anything about the time passes informations in the output and I also get this warning during the build with make:
clang: warning: argument unused during compilation: ‘-mllvm -time-passes’
Maybe the warning is due to the fact that the timing code is disabled, but I am not sure since it doesn’t seem to work on a simple file.

Have I done something wrong or am I missing something? Do you have any other suggestion?

I really appreciated your help!
Thank you in advance,


Apologies, I could've sworn I've done that before. It certianly works
with -stats.

Anyway, give -ftime-report a shot?

Alternatively, explicitly build the code into IR and use -time-passes with opt.

Hope this helps!