diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-04-10 18:53:28 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-04-10 18:53:28 +0000 |
commit | ade321e7ddf76483ea8b9fd2921216e026c9dc1b (patch) | |
tree | 9d0f22b8eec20831e79785ad0ec7f366197fd6e3 /clang/lib/Lex | |
parent | 298e1712d827a05b2cbb2936a9fc67745fa68c13 (diff) | |
download | bcm5719-llvm-ade321e7ddf76483ea8b9fd2921216e026c9dc1b.tar.gz bcm5719-llvm-ade321e7ddf76483ea8b9fd2921216e026c9dc1b.zip |
Revert r329684 (and follow-ups 329693, 329714). See discussion on https://reviews.llvm.org/D43578.
llvm-svn: 329739
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 26 | ||||
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 17 | ||||
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 12 |
3 files changed, 4 insertions, 51 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 3d908466128..93a5ad4c921 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -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::getCachedModuleFileName(StringRef ModuleName, } 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(StringRef ModuleName, bool AllowSearch) { } 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::LookupFile( 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::DoFrameworkLookup( 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::LookupFile( 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 Filename, 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(const FileEntry *FE, 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 &HS, const FileEntry *File, 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::findUsableModuleForFrameworkHeader( 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 DirectoryEntry *Dir, bool IsSystem, } void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) { - llvm::NamedRegionTimer T("allmodules", "Collect All Modules", IncGroupName, - IncGroupDescription, llvm::TimePassesIsEnabled); Modules.clear(); if (HSOpts->ImplicitModuleMaps) { diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 7c44cc84300..5af8ba57241 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -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::getLocalMacroDirectiveHistory(const IdentifierInfo *II) const { 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::addModuleMacro(Module *Mod, IdentifierInfo *II, 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(const IdentifierInfo *II, 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(Preprocessor &PP, 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(); diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index a1944e30ffb..db32e452d07 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -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(Preprocessor &PP, /// 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); |