blob: 002a14892249d67379ed68c260cad14207976cd4 [file] [log] [blame]
Roman Lebedev12152512018-05-08 13:14:21 +00001//===--- ClangTidyProfiling.h - clang-tidy ----------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
11#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
12
13#include "llvm/ADT/StringMap.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Timer.h"
16#include "llvm/Support/raw_ostream.h"
17#include <utility>
18#include <vector>
19
20namespace clang {
21namespace tidy {
22
23class ClangTidyProfiling {
24 // Time is first to allow for sorting by it.
25 std::vector<std::pair<llvm::TimeRecord, llvm::StringRef>> Timers;
26 llvm::TimeRecord Total;
27
28 void preprocess();
29
30 void printProfileData(llvm::raw_ostream &OS) const;
31
32public:
33 llvm::StringMap<llvm::TimeRecord> Records;
34
35 ~ClangTidyProfiling();
36};
37
38} // end namespace tidy
39} // end namespace clang
40
41#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H