summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidyProfiling.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidyProfiling.h')
-rw-r--r--clang-tools-extra/clang-tidy/ClangTidyProfiling.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyProfiling.h b/clang-tools-extra/clang-tidy/ClangTidyProfiling.h
new file mode 100644
index 00000000000..002a1489224
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/ClangTidyProfiling.h
@@ -0,0 +1,41 @@
+//===--- ClangTidyProfiling.h - clang-tidy ----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
+
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Timer.h"
+#include "llvm/Support/raw_ostream.h"
+#include <utility>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+
+class ClangTidyProfiling {
+ // Time is first to allow for sorting by it.
+ std::vector<std::pair<llvm::TimeRecord, llvm::StringRef>> Timers;
+ llvm::TimeRecord Total;
+
+ void preprocess();
+
+ void printProfileData(llvm::raw_ostream &OS) const;
+
+public:
+ llvm::StringMap<llvm::TimeRecord> Records;
+
+ ~ClangTidyProfiling();
+};
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
OpenPOWER on IntegriCloud