To simplify the review and commit of D43578 I decided to spilt it in several small parts.
This patch is the first part of the new series of patches. This patch introduces a dedicated boolean to deal with -ftime-report Clang switch (instead of 'llvm::TimePassesIsEnabled' which was LLVM dependent and potentionally could increase Clang compilation time).
Next patch will show usage of llvm::NamedRegionTimer instead of llvm::TimeRegion - it will really improve the generating output of the given feature.
Then I'll show the new class to deal with reqursive time counters (instead of approach shown in CodeGenAction.cpp).
And then we'll try new time counters (Preprocessor, Include Files, Parsing, Sema, CodeGen, etc.) The final list of counters will grow in dpendence of possible future requirements.
Finally, I'm going to introduce the feature which is similar to this one.
Hope, all these efforts could be interesting for many of us.