[cfe-dev] Adding more fine-grained -ftime_report info to clang front end

Nikola Smiljanic popizdeh at gmail.com
Sat Aug 1 21:39:06 PDT 2015


I don't think that approach will give you any useful information. You can
already use -fsyntax-only to get some idea how much time is spent on
lex-parse-sema phase compared to irgen. The former is likely to dominate
your compile time. Getting useful timings from that phase is hard. Using
-Xclang -print-stats might give you some idea where to look for the source
of your problem. Things to explore, size of preprocessed file and where
most of the code is coming from, template instantiations, and if I remember
correctly Chandler was saying that overload resolution can be slow for
functions with large number of overloads (or something like that).
Commenting out code in the file would be my next step.

On Sun, Aug 2, 2015 at 7:34 AM, Mark Pauley <pauley at unsaturated.net> wrote:

> Hi List,
>         I just found -ftime_report flag, and attempted to use it in order
> to diagnose why a particular c++ file in my source base is taking many
> seconds to compile. Unfortunately, it looks like all of the time is spent
> in the front end, where there are no fine-grained diagnostic metrics.  I’m
> guessing #includes and template instantiation (I’m looking at you, boost)
> but I want to know for sure.
>
> So to that end, I am thinking of using the llvm::TimePassesIsEnabled flag,
> and adding timers (llvm::Timer) to each of the different subclasses of
> clang::FrontEndAction to try and get a bead on where all of the time is
> going.  Does this sound like a good idea?  I am afraid that -ftime_report
> is aiming at the back end (because of the -f prefix), but it would really
> be great to allow the front ends to contribute to that view.
>
>
> Thanks in advance for the help!
>
> -Mark Pauley
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150802/f3acf077/attachment.html>


More information about the cfe-dev mailing list