diff options
author | Andrew V. Tischenko <andrew.v.tischenko@gmail.com> | 2018-04-10 10:34:13 +0000 |
---|---|---|
committer | Andrew V. Tischenko <andrew.v.tischenko@gmail.com> | 2018-04-10 10:34:13 +0000 |
commit | c88deb100f1d4a1d14dbcc42de01d325919ebec6 (patch) | |
tree | 36fe084ef5681b5e643f8eb90483a14f00df70d4 /clang/lib/Sema/Sema.cpp | |
parent | 037d3b20d3c0d9ea5c90aec9de3a5257d46b70c9 (diff) | |
download | bcm5719-llvm-c88deb100f1d4a1d14dbcc42de01d325919ebec6.tar.gz bcm5719-llvm-c88deb100f1d4a1d14dbcc42de01d325919ebec6.zip |
-ftime-report switch support in Clang.
The current support of the feature produces only 2 lines in report:
-Some general Code Generation Time;
-Total time of Backend Consumer actions.
This patch extends Clang time report with new lines related to Preprocessor, Include Filea Search, Parsing, etc.
Differential Revision: https://reviews.llvm.org/D43578
llvm-svn: 329684
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 5c0026cd374..928d8732211 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -40,6 +40,7 @@ #include "clang/Sema/TemplateInstCallback.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallSet.h" +#include "llvm/Support/Timer.h" using namespace clang; using namespace sema; @@ -842,6 +843,9 @@ void Sema::ActOnStartOfTranslationUnit() { /// translation unit when EOF is reached and all but the top-level scope is /// popped. void Sema::ActOnEndOfTranslationUnit() { + llvm::NamedRegionTimer T( + "actoneou1", "Act On End Of Translation Unit: Common case", + GroupName, GroupDescription, llvm::TimePassesIsEnabled); assert(DelayedDiagnostics.getCurrentPool() == nullptr && "reached end of translation unit with a pool attached?"); @@ -867,6 +871,10 @@ void Sema::ActOnEndOfTranslationUnit() { // Complete translation units and modules define vtables and perform implicit // instantiations. PCH files do not. if (TUKind != TU_Prefix) { + llvm::NamedRegionTimer T( + "actoneou2", + "Act On End Of Translation Unit: TUKind != TU_Prefix", GroupName, + GroupDescription, llvm::TimePassesIsEnabled); DiagnoseUseOfUnimplementedSelectors(); // If DefinedUsedVTables ends up marking any virtual member functions it @@ -929,6 +937,10 @@ void Sema::ActOnEndOfTranslationUnit() { UnusedFileScopedDecls.end()); if (TUKind == TU_Prefix) { + llvm::NamedRegionTimer T( + "actoneou3", + "Act On End Of Translation Unit: TUKind == TU_Prefix", GroupName, + GroupDescription, llvm::TimePassesIsEnabled); // Translation unit prefixes don't need any of the checking below. if (!PP.isIncrementalProcessingEnabled()) TUScope = nullptr; @@ -963,6 +975,10 @@ void Sema::ActOnEndOfTranslationUnit() { } if (TUKind == TU_Module) { + llvm::NamedRegionTimer T( + "actoneou4", + "Act On End Of Translation Unit: TUKind == TU_Module", GroupName, + GroupDescription, llvm::TimePassesIsEnabled); // If we are building a module interface unit, we need to have seen the // module declaration by now. if (getLangOpts().getCompilingModule() == @@ -1557,6 +1573,9 @@ void ExternalSemaSource::ReadMismatchingDeleteExpressions(llvm::MapVector< /// name, this parameter is populated with the decls of the various overloads. bool Sema::tryExprAsCall(Expr &E, QualType &ZeroArgCallReturnTy, UnresolvedSetImpl &OverloadSet) { + llvm::NamedRegionTimer T("tryascall", "Try Expr As Call", GroupName, + GroupDescription, llvm::TimePassesIsEnabled); + ZeroArgCallReturnTy = QualType(); OverloadSet.clear(); @@ -1719,6 +1738,9 @@ static bool IsCallableWithAppend(Expr *E) { bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD, bool ForceComplain, bool (*IsPlausibleResult)(QualType)) { + llvm::NamedRegionTimer T("trytorecover", "Try To Recover With Call", + GroupName, GroupDescription, + llvm::TimePassesIsEnabled); SourceLocation Loc = E.get()->getExprLoc(); SourceRange Range = E.get()->getSourceRange(); |