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!