r329739 - Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 10 11:53:28 PDT 2018


Author: nico
Date: Tue Apr 10 11:53:28 2018
New Revision: 329739

URL: http://llvm.org/viewvc/llvm-project?rev=329739&view=rev
Log:
Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578.

Modified:
    cfe/trunk/include/clang/Frontend/FrontendAction.h
    cfe/trunk/include/clang/Lex/HeaderSearch.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/CodeGen/CodeGenAction.cpp
    cfe/trunk/lib/Frontend/ASTMerge.cpp
    cfe/trunk/lib/Frontend/CompilerInstance.cpp
    cfe/trunk/lib/Frontend/FrontendAction.cpp
    cfe/trunk/lib/Frontend/FrontendActions.cpp
    cfe/trunk/lib/Lex/HeaderSearch.cpp
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/lib/Lex/Pragma.cpp
    cfe/trunk/lib/Parse/ParseTemplate.cpp
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/lib/Sema/SemaTemplate.cpp

Modified: cfe/trunk/include/clang/Frontend/FrontendAction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendAction.h?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendAction.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendAction.h Tue Apr 10 11:53:28 2018
@@ -45,9 +45,6 @@ private:
                                                         StringRef InFile);
 
 protected:
-  static constexpr const char *GroupName = "factions";
-  static constexpr const char *GroupDescription =
-      "===== Frontend Actions =====";
   /// @name Implementation Action Interface
   /// @{
 

Modified: cfe/trunk/include/clang/Lex/HeaderSearch.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/HeaderSearch.h (original)
+++ cfe/trunk/include/clang/Lex/HeaderSearch.h Tue Apr 10 11:53:28 2018
@@ -21,10 +21,9 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
-#include "llvm/Support/Timer.h"
 #include <cassert>
 #include <cstddef>
 #include <memory>
@@ -32,9 +31,6 @@
 #include <utility>
 #include <vector>
 
-static const char *const IncGroupName = "includefiles";
-static const char *const IncGroupDescription = "===== Include Files =====";
-
 namespace clang {
 
 class DiagnosticsEngine;

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Apr 10 11:53:28 2018
@@ -2851,6 +2851,4 @@ private:
 
 }  // end namespace clang
 
-static const char *const GroupName = "clangparser";
-static const char *const GroupDescription = "===== Clang Parser =====";
 #endif

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Apr 10 11:53:28 2018
@@ -304,9 +304,6 @@ class Sema {
   bool shouldLinkPossiblyHiddenDecl(LookupResult &Old, const NamedDecl *New);
 
 public:
-  static constexpr const char *GroupName = "sema";
-  static constexpr const char *GroupDescription = "===== Sema =====";
-
   typedef OpaquePtr<DeclGroupRef> DeclGroupPtrTy;
   typedef OpaquePtr<TemplateName> TemplateTy;
   typedef OpaquePtr<QualType> TypeTy;

Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Tue Apr 10 11:53:28 2018
@@ -23,7 +23,6 @@
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
 #include "clang/Lex/Preprocessor.h"
-#include "clang/Rewrite/Frontend/FrontendActions.h"
 #include "llvm/Bitcode/BitcodeReader.h"
 #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
 #include "llvm/IR/DebugInfo.h"
@@ -52,7 +51,7 @@ namespace clang {
   public:
     ClangDiagnosticHandler(const CodeGenOptions &CGOpts, BackendConsumer *BCon)
         : CodeGenOpts(CGOpts), BackendCon(BCon) {}
-
+  
     bool handleDiagnostics(const DiagnosticInfo &DI) override;
 
     bool isAnalysisRemarkEnabled(StringRef PassName) const override {
@@ -91,8 +90,9 @@ namespace clang {
     const LangOptions &LangOpts;
     std::unique_ptr<raw_pwrite_stream> AsmOutStream;
     ASTContext *Context;
-    static constexpr const char *GroupName = "frontend";
-    static constexpr const char *GroupDescription = "===== Frontend =====";
+
+    Timer LLVMIRGeneration;
+    unsigned LLVMIRGenerationRefCount;
 
     /// True if we've finished generating IR. This prevents us from generating
     /// additional LLVM IR after emitting output in HandleTranslationUnit. This
@@ -121,6 +121,8 @@ namespace clang {
         : Diags(Diags), Action(Action), HeaderSearchOpts(HeaderSearchOpts),
           CodeGenOpts(CodeGenOpts), TargetOpts(TargetOpts), LangOpts(LangOpts),
           AsmOutStream(std::move(OS)), Context(nullptr),
+          LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
+          LLVMIRGenerationRefCount(0),
           Gen(CreateLLVMCodeGen(Diags, InFile, HeaderSearchOpts, PPOpts,
                                 CodeGenOpts, C, CoverageInfo)),
           LinkModules(std::move(LinkModules)) {
@@ -139,22 +141,38 @@ namespace clang {
 
     void Initialize(ASTContext &Ctx) override {
       assert(!Context && "initialized multiple times");
+
       Context = &Ctx;
-      NamedRegionTimer T("initbackendconsumer", "Init Backend Consumer",
-                         GroupName, GroupDescription,
-                         llvm::TimePassesIsEnabled);
+
+      if (llvm::TimePassesIsEnabled)
+        LLVMIRGeneration.startTimer();
+
       Gen->Initialize(Ctx);
+
+      if (llvm::TimePassesIsEnabled)
+        LLVMIRGeneration.stopTimer();
     }
 
     bool HandleTopLevelDecl(DeclGroupRef D) override {
       PrettyStackTraceDecl CrashInfo(*D.begin(), SourceLocation(),
                                      Context->getSourceManager(),
                                      "LLVM IR generation of declaration");
-      NamedRegionTimer T("handlehophevelhecl", "Handle Top Level Decl",
-                         GroupName, GroupDescription,
-                         llvm::TimePassesIsEnabled);
+
+      // Recurse.
+      if (llvm::TimePassesIsEnabled) {
+        LLVMIRGenerationRefCount += 1;
+        if (LLVMIRGenerationRefCount == 1)
+          LLVMIRGeneration.startTimer();
+      }
 
       Gen->HandleTopLevelDecl(D);
+
+      if (llvm::TimePassesIsEnabled) {
+        LLVMIRGenerationRefCount -= 1;
+        if (LLVMIRGenerationRefCount == 0)
+          LLVMIRGeneration.stopTimer();
+      }
+
       return true;
     }
 
@@ -162,11 +180,13 @@ namespace clang {
       PrettyStackTraceDecl CrashInfo(D, SourceLocation(),
                                      Context->getSourceManager(),
                                      "LLVM IR generation of inline function");
-      NamedRegionTimer T("handleinlinefunction",
-                         "Handle Inline Function Definition", GroupName,
-                         GroupDescription, llvm::TimePassesIsEnabled);
+      if (llvm::TimePassesIsEnabled)
+        LLVMIRGeneration.startTimer();
 
       Gen->HandleInlineFunctionDefinition(D);
+
+      if (llvm::TimePassesIsEnabled)
+        LLVMIRGeneration.stopTimer();
     }
 
     void HandleInterestingDecl(DeclGroupRef D) override {
@@ -177,8 +197,6 @@ namespace clang {
 
     // Links each entry in LinkModules into our module.  Returns true on error.
     bool LinkInModules() {
-      NamedRegionTimer T("linkinmodules", "Link In Modules", GroupName,
-                         GroupDescription, llvm::TimePassesIsEnabled);
       for (auto &LM : LinkModules) {
         if (LM.PropagateAttrs)
           for (Function &F : *LM.Module)
@@ -209,12 +227,21 @@ namespace clang {
     void HandleTranslationUnit(ASTContext &C) override {
       {
         PrettyStackTraceString CrashInfo("Per-file LLVM IR generation");
-        NamedRegionTimer T("handletranslationunit", "Handle Translation Unit",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
+        if (llvm::TimePassesIsEnabled) {
+          LLVMIRGenerationRefCount += 1;
+          if (LLVMIRGenerationRefCount == 1)
+            LLVMIRGeneration.startTimer();
+        }
 
         Gen->HandleTranslationUnit(C);
-        IRGenFinished = true;
+
+        if (llvm::TimePassesIsEnabled) {
+          LLVMIRGenerationRefCount -= 1;
+          if (LLVMIRGenerationRefCount == 0)
+            LLVMIRGeneration.stopTimer();
+        }
+
+	IRGenFinished = true;
       }
 
       // Silently ignore if we weren't initialized for some reason.
@@ -282,37 +309,23 @@ namespace clang {
     }
 
     void HandleTagDeclRequiredDefinition(const TagDecl *D) override {
-      NamedRegionTimer T("handletagdecl",
-                         "Handle Tag Decl Required Definition", GroupName,
-                         GroupDescription, llvm::TimePassesIsEnabled);
       Gen->HandleTagDeclRequiredDefinition(D);
     }
 
     void CompleteTentativeDefinition(VarDecl *D) override {
-      NamedRegionTimer T("completetentative",
-                         "Complete Tentative Definition", GroupName,
-                         GroupDescription, llvm::TimePassesIsEnabled);
       Gen->CompleteTentativeDefinition(D);
     }
 
     void AssignInheritanceModel(CXXRecordDecl *RD) override {
-      NamedRegionTimer T("assigninheritance", "Assign Inheritance Model",
-                         GroupName, GroupDescription,
-                         llvm::TimePassesIsEnabled);
       Gen->AssignInheritanceModel(RD);
     }
 
     void HandleVTable(CXXRecordDecl *RD) override {
-      NamedRegionTimer T("handlevtable", "Handle VTable", GroupName,
-                         GroupDescription, llvm::TimePassesIsEnabled);
       Gen->HandleVTable(RD);
     }
 
     static void InlineAsmDiagHandler(const llvm::SMDiagnostic &SM,void *Context,
                                      unsigned LocCookie) {
-      NamedRegionTimer T("inlineasmhandler", "Inline Asm Diag Handler",
-                         GroupName, GroupDescription,
-                         llvm::TimePassesIsEnabled);
       SourceLocation Loc = SourceLocation::getFromRawEncoding(LocCookie);
       ((BackendConsumer*)Context)->InlineAsmDiagHandler2(SM, Loc);
     }
@@ -919,8 +932,6 @@ static void BitcodeInlineAsmDiagHandler(
 }
 
 std::unique_ptr<llvm::Module> CodeGenAction::loadModule(MemoryBufferRef MBRef) {
-  NamedRegionTimer T("loadmodule", "Load Module", GroupName, GroupDescription,
-                     llvm::TimePassesIsEnabled);
   CompilerInstance &CI = getCompilerInstance();
   SourceManager &SM = CI.getSourceManager();
 
@@ -988,8 +999,6 @@ std::unique_ptr<llvm::Module> CodeGenAct
 void CodeGenAction::ExecuteAction() {
   // If this is an IR file, we have to treat it specially.
   if (getCurrentFileKind().getLanguage() == InputKind::LLVM_IR) {
-    NamedRegionTimer T("executeaction", "LLVM_IR ExecuteAction", GroupName,
-                       GroupDescription, llvm::TimePassesIsEnabled);
     BackendAction BA = static_cast<BackendAction>(Act);
     CompilerInstance &CI = getCompilerInstance();
     std::unique_ptr<raw_pwrite_stream> OS =

Modified: cfe/trunk/lib/Frontend/ASTMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTMerge.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTMerge.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTMerge.cpp Tue Apr 10 11:53:28 2018
@@ -6,14 +6,13 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+#include "clang/Frontend/ASTUnit.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTDiagnostic.h"
 #include "clang/AST/ASTImporter.h"
 #include "clang/Basic/Diagnostic.h"
-#include "clang/Frontend/ASTUnit.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/FrontendActions.h"
-#include "llvm/Support/Timer.h"
 
 using namespace clang;
 
@@ -32,8 +31,6 @@ bool ASTMergeAction::BeginSourceFileActi
 }
 
 void ASTMergeAction::ExecuteAction() {
-  llvm::NamedRegionTimer T("astmerge", "AST Merge actions", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   CompilerInstance &CI = getCompilerInstance();
   CI.getDiagnostics().getClient()->BeginSourceFile(
                                              CI.getASTContext().getLangOpts());

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Tue Apr 10 11:53:28 2018
@@ -54,8 +54,6 @@
 #include <utility>
 
 using namespace clang;
-static const char *const GroupName = "frontend";
-static const char *const GroupDescription = "===== Frontend =====";
 
 CompilerInstance::CompilerInstance(
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -937,10 +935,6 @@ bool CompilerInstance::ExecuteAction(Fro
   assert(!getFrontendOpts().ShowHelp && "Client must handle '-help'!");
   assert(!getFrontendOpts().ShowVersion && "Client must handle '-version'!");
 
-  llvm::NamedRegionTimer T("compilerinstance", "Compiler Instance actions",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
-
   // FIXME: Take this as an argument, once all the APIs we used have moved to
   // taking it as an input instead of hard-coding llvm::errs.
   raw_ostream &OS = llvm::errs();

Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Tue Apr 10 11:53:28 2018
@@ -23,7 +23,6 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "clang/Parse/ParseAST.h"
-#include "clang/Rewrite/Frontend/FrontendActions.h"
 #include "clang/Serialization/ASTDeserializationListener.h"
 #include "clang/Serialization/ASTReader.h"
 #include "clang/Serialization/GlobalModuleIndex.h"

Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Tue Apr 10 11:53:28 2018
@@ -262,8 +262,6 @@ VerifyPCHAction::CreateASTConsumer(Compi
 }
 
 void VerifyPCHAction::ExecuteAction() {
-  llvm::NamedRegionTimer T("verifypch", "Verify PCH actions", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   CompilerInstance &CI = getCompilerInstance();
   bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
   const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot;
@@ -661,8 +659,6 @@ void PreprocessOnlyAction::ExecuteAction
 }
 
 void PrintPreprocessedAction::ExecuteAction() {
-  llvm::NamedRegionTimer T("printpp", "Print PP actions", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   CompilerInstance &CI = getCompilerInstance();
   // Output file may need to be set to 'Binary', to avoid converting Unix style
   // line feeds (<LF>) to Microsoft style line feeds (<CR><LF>).

Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Tue Apr 10 11:53:28 2018
@@ -30,13 +30,11 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Capacity.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
-#include "llvm/Support/Timer.h"
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -201,9 +199,6 @@ std::string HeaderSearch::getCachedModul
 }
 
 Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) {
-  llvm::NamedRegionTimer T("lookupmodule", "Lookup Module", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
-
   // Look in the module map to determine if there is a module by this name.
   Module *Module = ModMap.findModule(ModuleName);
   if (Module || !AllowSearch || !HSOpts->ImplicitModuleMaps)
@@ -228,8 +223,6 @@ Module *HeaderSearch::lookupModule(Strin
 }
 
 Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName) {
-  llvm::NamedRegionTimer T("lookupmodule", "Lookup Module", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
   Module *Module = nullptr;
 
   // Look through the various header search paths to load any available module
@@ -347,8 +340,6 @@ const FileEntry *DirectoryLookup::Lookup
     bool &InUserSpecifiedSystemFramework,
     bool &HasBeenMapped,
     SmallVectorImpl<char> &MappedName) const {
-  llvm::NamedRegionTimer T("lookupfile", "Lookup File", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
   InUserSpecifiedSystemFramework = false;
   HasBeenMapped = false;
 
@@ -476,8 +467,6 @@ const FileEntry *DirectoryLookup::DoFram
     SmallVectorImpl<char> *RelativePath, Module *RequestingModule,
     ModuleMap::KnownHeader *SuggestedModule,
     bool &InUserSpecifiedSystemFramework) const {
-  llvm::NamedRegionTimer T("lookupfw", "Lookup Framework", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
   FileManager &FileMgr = HS.getFileMgr();
 
   // Framework names must have a '/' in the filename.
@@ -644,8 +633,6 @@ const FileEntry *HeaderSearch::LookupFil
     SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath,
     Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule,
     bool *IsMapped, bool SkipCache, bool BuildSystemModule) {
-  llvm::NamedRegionTimer T("lookupfile2", "Lookup File2", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
   if (IsMapped)
     *IsMapped = false;
 
@@ -907,8 +894,6 @@ LookupSubframeworkHeader(StringRef Filen
                          Module *RequestingModule,
                          ModuleMap::KnownHeader *SuggestedModule) {
   assert(ContextFileEnt && "No context file?");
-  llvm::NamedRegionTimer T("lookupsubfm", "Lookup SubFramework", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
 
   // Framework names must have a '/' in the filename.  Find it.
   // FIXME: Should we permit '\' on Windows?
@@ -1126,9 +1111,6 @@ void HeaderSearch::MarkFileModuleHeader(
 bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP,
                                           const FileEntry *File, bool isImport,
                                           bool ModulesEnabled, Module *M) {
-  llvm::NamedRegionTimer T("shouldenterinc", "Should Enter Include File",
-                           IncGroupName, IncGroupDescription,
-                           llvm::TimePassesIsEnabled);
   ++NumIncluded; // Count # of attempted #includes.
 
   // Get information about this file.
@@ -1305,9 +1287,6 @@ static bool suggestModule(HeaderSearch &
 bool HeaderSearch::findUsableModuleForHeader(
     const FileEntry *File, const DirectoryEntry *Root, Module *RequestingModule,
     ModuleMap::KnownHeader *SuggestedModule, bool IsSystemHeaderDir) {
-  llvm::NamedRegionTimer T("findmodule4header", "Find Usable Module For Header",
-                           IncGroupName, IncGroupDescription,
-                           llvm::TimePassesIsEnabled);
   if (File && needModuleLookup(RequestingModule, SuggestedModule)) {
     // If there is a module that corresponds to this header, suggest it.
     hasModuleMap(File->getName(), Root, IsSystemHeaderDir);
@@ -1320,9 +1299,6 @@ bool HeaderSearch::findUsableModuleForFr
     const FileEntry *File, StringRef FrameworkName, Module *RequestingModule,
     ModuleMap::KnownHeader *SuggestedModule, bool IsSystemFramework) {
   // If we're supposed to suggest a module, look for one now.
-  llvm::NamedRegionTimer T(
-      "findmodule4fwheader", "Find Usable Module For Framework Header",
-      IncGroupName, IncGroupDescription, llvm::TimePassesIsEnabled);
   if (needModuleLookup(RequestingModule, SuggestedModule)) {
     // Find the top-level framework based on this framework.
     SmallVector<std::string, 4> SubmodulePath;
@@ -1507,8 +1483,6 @@ HeaderSearch::loadModuleMapFile(const Di
 }
 
 void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
-  llvm::NamedRegionTimer T("allmodules", "Collect All Modules", IncGroupName,
-                           IncGroupDescription, llvm::TimePassesIsEnabled);
   Modules.clear();
 
   if (HSOpts->ImplicitModuleMaps) {

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Apr 10 11:53:28 2018
@@ -26,9 +26,9 @@
 #include "clang/Lex/LexDiagnostic.h"
 #include "clang/Lex/MacroArgs.h"
 #include "clang/Lex/MacroInfo.h"
-#include "clang/Lex/PTHLexer.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PreprocessorLexer.h"
+#include "clang/Lex/PTHLexer.h"
 #include "clang/Lex/Token.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
@@ -36,16 +36,15 @@
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
-#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Format.h"
-#include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 #include <cassert>
@@ -58,9 +57,6 @@
 
 using namespace clang;
 
-static const char *const GroupName = "clangparser";
-static const char *const GroupDescription = "===== Clang Parser =====";
-
 MacroDirective *
 Preprocessor::getLocalMacroDirectiveHistory(const IdentifierInfo *II) const {
   if (!II->hadMacroDefinition())
@@ -73,8 +69,6 @@ Preprocessor::getLocalMacroDirectiveHist
 void Preprocessor::appendMacroDirective(IdentifierInfo *II, MacroDirective *MD){
   assert(MD && "MacroDirective should be non-zero!");
   assert(!MD->getPrevious() && "Already attached to a MacroDirective history.");
-  llvm::NamedRegionTimer NRT("appendmacro", "PP Append Macro", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
 
   MacroState &StoredMD = CurSubmoduleState->Macros[II];
   auto *OldMD = StoredMD.getLatest();
@@ -137,8 +131,6 @@ ModuleMacro *Preprocessor::addModuleMacr
                                           MacroInfo *Macro,
                                           ArrayRef<ModuleMacro *> Overrides,
                                           bool &New) {
-  llvm::NamedRegionTimer NRT("addmodulemacro", "PP Add Module Macro", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
   llvm::FoldingSetNodeID ID;
   ModuleMacro::Profile(ID, Mod, II);
 
@@ -190,9 +182,6 @@ void Preprocessor::updateModuleMacroInfo
   assert(Info.ActiveModuleMacrosGeneration !=
              CurSubmoduleState->VisibleModules.getGeneration() &&
          "don't need to update this macro name info");
-  llvm::NamedRegionTimer NRT("updatemodulemacro", "PP Update Module Macro",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Info.ActiveModuleMacrosGeneration =
       CurSubmoduleState->VisibleModules.getGeneration();
 
@@ -765,8 +754,6 @@ static bool GenerateNewArgTokens(Preproc
 MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName,
                                                    MacroInfo *MI,
                                                    SourceLocation &MacroEnd) {
-  llvm::NamedRegionTimer NRT("ppmacrocall", "PP Macro Call Args", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
   // The number of fixed arguments to parse.
   unsigned NumFixedArgsLeft = MI->getNumParams();
   bool isVariadic = MI->isVariadic();

Modified: cfe/trunk/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Tue Apr 10 11:53:28 2018
@@ -39,13 +39,11 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/Compiler.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CrashRecoveryContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/Timer.h"
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -56,8 +54,6 @@
 #include <vector>
 
 using namespace clang;
-static const char *const GroupName = "clangparser";
-static const char *const GroupDescription = "===== Clang Parser =====";
 
 // Out-of-line destructor to provide a home for the class.
 PragmaHandler::~PragmaHandler() = default;
@@ -86,8 +82,6 @@ PragmaNamespace::~PragmaNamespace() {
 /// the null handler isn't returned on failure to match.
 PragmaHandler *PragmaNamespace::FindHandler(StringRef Name,
                                             bool IgnoreNull) const {
-  llvm::NamedRegionTimer NRT("ppfindhandler", "PP Find Handler", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
   if (PragmaHandler *Handler = Handlers.lookup(Name))
     return Handler;
   return IgnoreNull ? nullptr : Handlers.lookup(StringRef());
@@ -134,8 +128,6 @@ void PragmaNamespace::HandlePragma(Prepr
 /// rest of the pragma, passing it to the registered pragma handlers.
 void Preprocessor::HandlePragmaDirective(SourceLocation IntroducerLoc,
                                          PragmaIntroducerKind Introducer) {
-  llvm::NamedRegionTimer NRT("pppragma", "Handle Pragma Directive", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
   if (Callbacks)
     Callbacks->PragmaDirective(IntroducerLoc, Introducer);
 

Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Tue Apr 10 11:53:28 2018
@@ -19,7 +19,6 @@
 #include "clang/Sema/DeclSpec.h"
 #include "clang/Sema/ParsedTemplate.h"
 #include "clang/Sema/Scope.h"
-#include "llvm/Support/Timer.h"
 using namespace clang;
 
 /// \brief Parse a template declaration, explicit instantiation, or
@@ -29,8 +28,6 @@ Parser::ParseDeclarationStartingWithTemp
                                              SourceLocation &DeclEnd,
                                              AccessSpecifier AS,
                                              AttributeList *AccessAttrs) {
-  llvm::NamedRegionTimer NRT("parsetemplate", "Parse Template", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
   ObjCDeclContextSwitch ObjCDC(*this);
   
   if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) {

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Tue Apr 10 11:53:28 2018
@@ -20,7 +20,6 @@
 #include "clang/Sema/DeclSpec.h"
 #include "clang/Sema/ParsedTemplate.h"
 #include "clang/Sema/Scope.h"
-#include "llvm/Support/Timer.h"
 using namespace clang;
 
 
@@ -369,8 +368,6 @@ void Parser::EnterScope(unsigned ScopeFl
 /// ExitScope - Pop a scope off the scope stack.
 void Parser::ExitScope() {
   assert(getCurScope() && "Scope imbalance!");
-  llvm::NamedRegionTimer NRT("clangscope", "Scope manipulation", GroupName,
-                             GroupDescription, llvm::TimePassesIsEnabled);
 
   // Inform the actions module that this scope is going away if there are any
   // decls in it.
@@ -546,9 +543,6 @@ bool Parser::ParseFirstTopLevelDecl(Decl
 /// ParseTopLevelDecl - Parse one top-level declaration, return whatever the
 /// action tells us to.  This returns true if the EOF was encountered.
 bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) {
-  llvm::NamedRegionTimer NRT("parsetopleveldecl", "Parse Top Level Decl",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   DestroyTemplateIdAnnotationsRAIIObj CleanupRAII(TemplateIds);
 
   // Skip over the EOF token, flagging end of previous input for incremental
@@ -1052,9 +1046,6 @@ Parser::ParseDeclarationOrFunctionDefini
 Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
                                       const ParsedTemplateInfo &TemplateInfo,
                                       LateParsedAttrList *LateParsedAttrs) {
-  llvm::NamedRegionTimer NRT("parsefdef", "Parse Function Definition",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   // Poison SEH identifiers so they are flagged as illegal in function bodies.
   PoisonSEHIdentifiersRAIIObject PoisonSEHIdentifiers(*this, true);
   const DeclaratorChunk::FunctionTypeInfo &FTI = D.getFunctionTypeInfo();
@@ -1931,9 +1922,6 @@ bool Parser::isTokenEqualOrEqualTypo() {
 
 SourceLocation Parser::handleUnexpectedCodeCompletionToken() {
   assert(Tok.is(tok::code_completion));
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   PrevTokLocation = Tok.getLocation();
 
   for (Scope *S = getCurScope(); S; S = S->getParent()) {
@@ -1959,47 +1947,29 @@ SourceLocation Parser::handleUnexpectedC
 // Code-completion pass-through functions
 
 void Parser::CodeCompleteDirective(bool InConditional) {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Actions.CodeCompletePreprocessorDirective(InConditional);
 }
 
 void Parser::CodeCompleteInConditionalExclusion() {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Actions.CodeCompleteInPreprocessorConditionalExclusion(getCurScope());
 }
 
 void Parser::CodeCompleteMacroName(bool IsDefinition) {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Actions.CodeCompletePreprocessorMacroName(IsDefinition);
 }
 
-void Parser::CodeCompletePreprocessorExpression() {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
+void Parser::CodeCompletePreprocessorExpression() { 
   Actions.CodeCompletePreprocessorExpression();
 }
 
 void Parser::CodeCompleteMacroArgument(IdentifierInfo *Macro,
                                        MacroInfo *MacroInfo,
                                        unsigned ArgumentIndex) {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Actions.CodeCompletePreprocessorMacroArgument(getCurScope(), Macro, MacroInfo,
                                                 ArgumentIndex);
 }
 
 void Parser::CodeCompleteNaturalLanguage() {
-  llvm::NamedRegionTimer NRT("codecompletion", "Code completion operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   Actions.CodeCompleteNaturalLanguage();
 }
 
@@ -2108,9 +2078,6 @@ void Parser::ParseMicrosoftIfExistsExter
 ///
 /// Note that 'partition' is a context-sensitive keyword.
 Parser::DeclGroupPtrTy Parser::ParseModuleDecl() {
-  llvm::NamedRegionTimer NRT("moduleoperations", "Module related operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   SourceLocation StartLoc = Tok.getLocation();
 
   Sema::ModuleDeclKind MDK = TryConsumeToken(tok::kw_export)
@@ -2156,9 +2123,6 @@ Decl *Parser::ParseModuleImport(SourceLo
   assert((AtLoc.isInvalid() ? Tok.is(tok::kw_import)
                             : Tok.isObjCAtKeyword(tok::objc_import)) &&
          "Improper start to module import");
-  llvm::NamedRegionTimer NRT("moduleoperations", "Module related operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   SourceLocation ImportLoc = ConsumeToken();
   SourceLocation StartLoc = AtLoc.isInvalid() ? ImportLoc : AtLoc;
   
@@ -2196,9 +2160,6 @@ bool Parser::ParseModuleName(
     SourceLocation UseLoc,
     SmallVectorImpl<std::pair<IdentifierInfo *, SourceLocation>> &Path,
     bool IsImport) {
-  llvm::NamedRegionTimer NRT("moduleoperations", "Module related operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   // Parse the module path.
   while (true) {
     if (!Tok.is(tok::identifier)) {
@@ -2229,9 +2190,6 @@ bool Parser::ParseModuleName(
 /// \returns false if the recover was successful and parsing may be continued, or
 /// true if parser must bail out to top level and handle the token there.
 bool Parser::parseMisplacedModuleImport() {
-  llvm::NamedRegionTimer NRT("moduleoperations", "Module related operations",
-                             GroupName, GroupDescription,
-                             llvm::TimePassesIsEnabled);
   while (true) {
     switch (Tok.getKind()) {
     case tok::annot_module_end:

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Apr 10 11:53:28 2018
@@ -40,7 +40,6 @@
 #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;
 
@@ -843,9 +842,6 @@ 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?");
 
@@ -871,10 +867,6 @@ 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
@@ -937,10 +929,6 @@ 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;
@@ -975,10 +963,6 @@ 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() ==
@@ -1573,9 +1557,6 @@ void ExternalSemaSource::ReadMismatching
 ///  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();
 
@@ -1738,9 +1719,6 @@ 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();
 

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Apr 10 11:53:28 2018
@@ -84,7 +84,6 @@
 #include "llvm/Support/Format.h"
 #include "llvm/Support/Locale.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 #include <cassert>
@@ -119,7 +118,7 @@ static bool checkArgCount(Sema &S, CallE
   // Highlight all the excess arguments.
   SourceRange range(call->getArg(desiredArgCount)->getLocStart(),
                     call->getArg(argCount - 1)->getLocEnd());
-
+    
   return S.Diag(range.getBegin(), diag::err_typecheck_call_too_many_args)
     << 0 /*function call*/ << desiredArgCount << argCount
     << call->getArg(1)->getSourceRange();
@@ -225,7 +224,7 @@ static bool SemaBuiltinOverflow(Sema &S,
 }
 
 static void SemaBuiltinMemChkCall(Sema &S, FunctionDecl *FDecl,
-                                  CallExpr *TheCall, unsigned SizeIdx,
+		                  CallExpr *TheCall, unsigned SizeIdx,
                                   unsigned DstSizeIdx) {
   if (TheCall->getNumArgs() <= SizeIdx ||
       TheCall->getNumArgs() <= DstSizeIdx)
@@ -492,9 +491,6 @@ static bool checkOpenCLEnqueueVariadicAr
 ///                    void (^block)(local void*, ...),
 ///                    uint size0, ...)
 static bool SemaOpenCLBuiltinEnqueueKernel(Sema &S, CallExpr *TheCall) {
-  llvm::NamedRegionTimer T(
-      "semaopenclbuiltin", "Sema OpenCL Builtin Enqueue Kernel",
-      Sema::GroupName, Sema::GroupDescription, llvm::TimePassesIsEnabled);
   unsigned NumArgs = TheCall->getNumArgs();
 
   if (NumArgs < 4) {
@@ -857,10 +853,6 @@ static bool SemaOpenCLBuiltinToAddr(Sema
 ExprResult
 Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
                                CallExpr *TheCall) {
-  llvm::NamedRegionTimer T("checkbuiltinfunction",
-                           "Check Builtin Function Call", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
-
   ExprResult TheCallResult(TheCall);
 
   // Find out if any arguments are required to be integer constant expressions.
@@ -2260,9 +2252,6 @@ bool Sema::CheckX86BuiltinGatherScatterS
 }
 
 bool Sema::CheckX86BuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
-  llvm::NamedRegionTimer T("checkx86builtin",
-                           "Check X86 Builtin Function Call", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   if (BuiltinID == X86::BI__builtin_cpu_supports)
     return SemaBuiltinCpuSupports(*this, TheCall);
 
@@ -2704,8 +2693,6 @@ void Sema::checkCall(NamedDecl *FDecl, c
                      const Expr *ThisArg, ArrayRef<const Expr *> Args,
                      bool IsMemberFunction, SourceLocation Loc,
                      SourceRange Range, VariadicCallType CallType) {
-  llvm::NamedRegionTimer T("checkcall", "Check Call", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   // FIXME: We should check as much as we can in the template definition.
   if (CurContext->isDependentContext())
     return;
@@ -3344,10 +3331,6 @@ static bool checkBuiltinArgument(Sema &S
 /// builtins,
 ExprResult
 Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
-  llvm::NamedRegionTimer T("semabuiltinatomic",
-                           "Sema Builtin Atomic Overloaded", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
-
   CallExpr *TheCall = (CallExpr *)TheCallResult.get();
   DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
   FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
@@ -9535,10 +9518,6 @@ static bool isSameWidthConstantConversio
 static void
 CheckImplicitConversion(Sema &S, Expr *E, QualType T, SourceLocation CC,
                         bool *ICContext = nullptr) {
-  llvm::NamedRegionTimer NRT("checkimplicit",
-                             "Check Implicit Conversion", Sema::GroupName,
-                             Sema::GroupDescription, llvm::TimePassesIsEnabled);
-
   if (E->isTypeDependent() || E->isValueDependent()) return;
 
   const Type *Source = S.Context.getCanonicalType(E->getType()).getTypePtr();

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Apr 10 11:53:28 2018
@@ -44,7 +44,6 @@
 #include "clang/Sema/Template.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Triple.h"
-#include "llvm/Support/Timer.h"
 #include <algorithm>
 #include <cstring>
 #include <functional>
@@ -850,8 +849,6 @@ Sema::ClassifyName(Scope *S, CXXScopeSpe
                    SourceLocation NameLoc, const Token &NextToken,
                    bool IsAddressOfOperand,
                    std::unique_ptr<CorrectionCandidateCallback> CCC) {
-  llvm::NamedRegionTimer T("classifyname", "Classify Name", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   DeclarationNameInfo NameInfo(Name, NameLoc);
   ObjCMethodDecl *CurMethod = getCurMethodDecl();
 
@@ -5324,8 +5321,6 @@ bool Sema::diagnoseQualifiedDeclaration(
 
 NamedDecl *Sema::HandleDeclarator(Scope *S, Declarator &D,
                                   MultiTemplateParamsArg TemplateParamLists) {
-  llvm::NamedRegionTimer T("handledeclarator", "Handle Declarator", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   // TODO: consider using NameInfo for diagnostic.
   DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
   DeclarationName Name = NameInfo.getName();

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Apr 10 11:53:28 2018
@@ -44,7 +44,6 @@
 #include "clang/Sema/SemaInternal.h"
 #include "clang/Sema/Template.h"
 #include "llvm/Support/ConvertUTF.h"
-#include "llvm/Support/Timer.h"
 using namespace clang;
 using namespace sema;
 
@@ -1309,10 +1308,6 @@ Sema::ActOnGenericSelectionExpr(SourceLo
                                 Expr *ControllingExpr,
                                 ArrayRef<ParsedType> ArgTypes,
                                 ArrayRef<Expr *> ArgExprs) {
-  llvm::NamedRegionTimer T("actongenericselection",
-                           "Act On Generic Selection Expr", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
-
   unsigned NumAssocs = ArgTypes.size();
   assert(NumAssocs == ArgExprs.size());
 
@@ -1525,9 +1520,6 @@ static ExprResult BuildCookedLiteralOper
 ExprResult
 Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {
   assert(!StringToks.empty() && "Must have at least one string!");
-  llvm::NamedRegionTimer T("actonstringliteral", "Act On String Literal",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
 
   StringLiteralParser Literal(StringToks, PP);
   if (Literal.hadError)
@@ -2035,9 +2027,6 @@ Sema::ActOnIdExpression(Scope *S, CXXSco
                         bool IsInlineAsmIdentifier, Token *KeywordReplacement) {
   assert(!(IsAddressOfOperand && HasTrailingLParen) &&
          "cannot be direct & operand and have a trailing lparen");
-  llvm::NamedRegionTimer T("actonid", "Act On Id Expression",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
   if (SS.isInvalid())
     return ExprError();
 
@@ -3074,10 +3063,6 @@ ExprResult Sema::BuildPredefinedExpr(Sou
 }
 
 ExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind) {
-  llvm::NamedRegionTimer T("actonpredefined", "Act On Predefined Expr",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
-
   PredefinedExpr::IdentType IT;
 
   switch (Kind) {

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=329739&r1=329738&r2=329739&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Tue Apr 10 11:53:28 2018
@@ -32,7 +32,6 @@
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Timer.h"
 
 #include <iterator>
 using namespace clang;
@@ -304,9 +303,6 @@ void Sema::LookupTemplateName(LookupResu
                               QualType ObjectType,
                               bool EnteringContext,
                               bool &MemberOfUnknownSpecialization) {
-  llvm::NamedRegionTimer T("lookuptemplate", "Lookup Template Name",
-                           GroupName, GroupDescription,
-                           llvm::TimePassesIsEnabled);
   // Determine where to perform name lookup
   MemberOfUnknownSpecialization = false;
   DeclContext *LookupCtx = nullptr;
@@ -547,9 +543,6 @@ Sema::ActOnDependentIdExpression(const C
                                  const DeclarationNameInfo &NameInfo,
                                  bool isAddressOfOperand,
                            const TemplateArgumentListInfo *TemplateArgs) {
-  llvm::NamedRegionTimer T("actondependent",
-                           "Act On Dependent Id Expression", GroupName,
-                           GroupDescription, llvm::TimePassesIsEnabled);
   DeclContext *DC = getFunctionLevelDeclContext();
 
   // C++11 [expr.prim.general]p12:




More information about the cfe-commits mailing list