[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clang-tidy / ClangTidyProfiling.h
blobb6f7d66343fa469c4d36fe69da675c9f8a3a1d2e
1 //===--- ClangTidyProfiling.h - clang-tidy ----------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
12 #include "llvm/ADT/StringMap.h"
13 #include "llvm/Support/Chrono.h"
14 #include "llvm/Support/Timer.h"
15 #include <optional>
16 #include <string>
18 namespace llvm {
19 class raw_ostream;
20 } // namespace llvm
22 namespace clang::tidy {
24 class ClangTidyProfiling {
25 public:
26 struct StorageParams {
27 llvm::sys::TimePoint<> Timestamp;
28 std::string SourceFilename;
29 std::string StoreFilename;
31 StorageParams() = default;
33 StorageParams(llvm::StringRef ProfilePrefix, llvm::StringRef SourceFile);
36 private:
37 std::optional<llvm::TimerGroup> TG;
39 std::optional<StorageParams> Storage;
41 void printUserFriendlyTable(llvm::raw_ostream &OS);
42 void printAsJSON(llvm::raw_ostream &OS);
44 void storeProfileData();
46 public:
47 llvm::StringMap<llvm::TimeRecord> Records;
49 ClangTidyProfiling() = default;
51 ClangTidyProfiling(std::optional<StorageParams> Storage);
53 ~ClangTidyProfiling();
56 } // namespace clang::tidy
58 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H