diff options
author | Volodymyr Sapsai <vsapsai@apple.com> | 2019-10-11 18:22:34 +0000 |
---|---|---|
committer | Volodymyr Sapsai <vsapsai@apple.com> | 2019-10-11 18:22:34 +0000 |
commit | e8752a9d1bcf7f68397d59cfe42eb304945dceec (patch) | |
tree | c7c81ce1c9e7f03f3a1e0a5afd05a1180fdb86c7 /clang/lib/Basic/FileManager.cpp | |
parent | 1e3a8d12a1a37fb2842af6c0fad8e5ba2804ea60 (diff) | |
download | bcm5719-llvm-e8752a9d1bcf7f68397d59cfe42eb304945dceec.tar.gz bcm5719-llvm-e8752a9d1bcf7f68397d59cfe42eb304945dceec.zip |
[Stats] Convert some ad-hoc header search stats to ALWAYS_ENABLED_STATISTIC.
rdar://problem/55715134
Reviewers: dsanders, bogner, rtereshin
Reviewed By: dsanders
Subscribers: hiraditya, jkorous, dexonsmith, ributzka, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68252
llvm-svn: 374581
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index f14bd0884a0..88a7a125083 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -18,9 +18,10 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/FileSystemStatCache.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Config/llvm-config.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" @@ -35,6 +36,14 @@ using namespace clang; +#define DEBUG_TYPE "file-search" + +ALWAYS_ENABLED_STATISTIC(NumDirLookups, "Number of directory lookups."); +ALWAYS_ENABLED_STATISTIC(NumFileLookups, "Number of file lookups."); +ALWAYS_ENABLED_STATISTIC(NumDirCacheMisses, + "Number of directory cache misses."); +ALWAYS_ENABLED_STATISTIC(NumFileCacheMisses, "Number of file cache misses."); + //===----------------------------------------------------------------------===// // Common logic. //===----------------------------------------------------------------------===// @@ -43,9 +52,6 @@ FileManager::FileManager(const FileSystemOptions &FSO, IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS) : FS(std::move(FS)), FileSystemOpts(FSO), SeenDirEntries(64), SeenFileEntries(64), NextFileUID(0) { - NumDirLookups = NumFileLookups = 0; - NumDirCacheMisses = NumFileCacheMisses = 0; - // If the caller doesn't provide a virtual file system, just grab the real // file system. if (!this->FS) |