9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H 15 #include "llvm/Support/raw_ostream.h" 21 class CompilerInstance;
23 class CompilationDatabase;
28 class ClangTidyCheckFactories;
34 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS =
nullptr);
37 std::unique_ptr<clang::ASTConsumer>
38 CreateASTConsumer(clang::CompilerInstance &Compiler, StringRef File);
48 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS;
49 std::unique_ptr<ClangTidyCheckFactories> CheckFactories;
65 bool AllowEnablingAnalyzerAlphaCheckers);
74 std::vector<ClangTidyError>
76 const tooling::CompilationDatabase &Compilations,
77 ArrayRef<std::string> InputFiles,
78 llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> BaseFS,
90 unsigned &WarningsAsErrorsCount,
91 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS);
96 const std::vector<ClangTidyError> &Errors,
102 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H
static cl::opt< std::string > StoreCheckProfile("store-check-profile", cl::desc(R"(
By default reports are printed in tabulated
format to stderr. When this option is passed,
these per-TU profiles are instead stored as JSON.
)"), cl::value_desc("prefix"), cl::cat(ClangTidyCategory))
Contains options for clang-tidy.
ClangTidyOptions::OptionMap getCheckOptions(const ClangTidyOptions &Options, bool AllowEnablingAnalyzerAlphaCheckers)
Returns the effective check-specific options.
void handleErrors(llvm::ArrayRef< ClangTidyError > Errors, ClangTidyContext &Context, bool Fix, unsigned &WarningsAsErrorsCount, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS)
Displays the found Errors to the users.
void exportReplacements(StringRef MainFilePath, const std::vector< ClangTidyError > &Errors, raw_ostream &OS)
Serializes replacements into YAML and writes them to the specified output stream. ...
static cl::opt< bool > AllowEnablingAnalyzerAlphaCheckers("allow-enabling-analyzer-alpha-checkers", cl::init(false), cl::Hidden, cl::cat(ClangTidyCategory))
This option allows enabling the experimental alpha checkers from the static analyzer.
std::map< std::string, std::string > OptionMap
static cl::opt< bool > EnableCheckProfile("enable-check-profile", cl::desc(R"(
Enable per-check timing profiles, and print a
report to stderr.
)"), cl::init(false), cl::cat(ClangTidyCategory))
std::vector< ClangTidyError > runClangTidy(clang::tidy::ClangTidyContext &Context, const tooling::CompilationDatabase &Compilations, ArrayRef< std::string > InputFiles, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > BaseFS, bool EnableCheckProfile=false, llvm::StringRef StoreCheckProfile=StringRef())
Run a set of clang-tidy checks on a set of files.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::vector< std::string > getCheckNames(const ClangTidyOptions &Options, bool AllowEnablingAnalyzerAlphaCheckers)
Fills the list of check names that are enabled when the provided filters are applied.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
static cl::opt< bool > Fix("fix", cl::desc(R"(
Apply suggested fixes. Without -fix-errors
clang-tidy will bail out if any compilation
errors were found.
)"), cl::init(false), cl::cat(ClangTidyCategory))