23#include "clang-tidy-config.h"
24#include "clang/AST/ASTConsumer.h"
25#include "clang/ASTMatchers/ASTMatchFinder.h"
26#include "clang/Format/Format.h"
27#include "clang/Frontend/ASTConsumers.h"
28#include "clang/Frontend/CompilerInstance.h"
29#include "clang/Frontend/FrontendDiagnostic.h"
30#include "clang/Frontend/MultiplexConsumer.h"
31#include "clang/Frontend/TextDiagnosticPrinter.h"
32#include "clang/Lex/PPCallbacks.h"
33#include "clang/Lex/Preprocessor.h"
34#include "clang/Lex/PreprocessorOptions.h"
35#include "clang/Rewrite/Frontend/FixItRewriter.h"
36#include "clang/Rewrite/Frontend/FrontendActions.h"
37#include "clang/Tooling/Core/Diagnostic.h"
38#include "clang/Tooling/DiagnosticsYaml.h"
39#include "clang/Tooling/Refactoring.h"
40#include "clang/Tooling/ReplacementsYaml.h"
41#include "clang/Tooling/Tooling.h"
42#include "llvm/Support/Process.h"
46#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
47#include "clang/Analysis/PathDiagnostic.h"
48#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
52using namespace clang::driver;
61#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
62static const char *AnalyzerCheckNamePrefix =
"clang-analyzer-";
64class AnalyzerDiagnosticConsumer :
public ento::PathDiagnosticConsumer {
66 AnalyzerDiagnosticConsumer(ClangTidyContext &Context) : Context(Context) {}
68 void FlushDiagnosticsImpl(std::vector<const ento::PathDiagnostic *> &Diags,
69 FilesMade *FilesMade)
override {
70 for (
const ento::PathDiagnostic *PD : Diags) {
71 SmallString<64> CheckName(AnalyzerCheckNamePrefix);
72 CheckName += PD->getCheckerName();
73 Context.diag(CheckName, PD->getLocation().asLocation(),
74 PD->getShortDescription())
75 << PD->path.back()->getRanges();
77 for (
const auto &DiagPiece :
78 PD->path.flatten(
true)) {
79 Context.diag(CheckName, DiagPiece->getLocation().asLocation(),
80 DiagPiece->getString(), DiagnosticIDs::Note)
81 << DiagPiece->getRanges();
86 StringRef getName()
const override {
return "ClangTidyDiags"; }
87 bool supportsLogicalOpControlFlow()
const override {
return true; }
88 bool supportsCrossFileDiagnostics()
const override {
return true; }
91 ClangTidyContext &Context;
97 ErrorReporter(ClangTidyContext &Context,
FixBehaviour ApplyFixes,
98 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS)
99 : Files(FileSystemOptions(), std::move(BaseFS)),
100 DiagOpts(new DiagnosticOptions()),
101 DiagPrinter(new TextDiagnosticPrinter(
llvm::outs(), &*DiagOpts)),
102 Diags(IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), &*DiagOpts,
104 SourceMgr(Diags, Files), Context(Context), ApplyFixes(ApplyFixes),
105 TotalFixes(0), AppliedFixes(0), WarningsAsErrors(0) {
106 DiagOpts->ShowColors = Context.getOptions().UseColor.value_or(
107 llvm::sys::Process::StandardOutHasColors());
108 DiagPrinter->BeginSourceFile(LangOpts);
109 if (DiagOpts->ShowColors && !llvm::sys::Process::StandardOutIsDisplayed()) {
110 llvm::sys::Process::UseANSIEscapeCodes(
true);
114 SourceManager &getSourceManager() {
return SourceMgr; }
117 const tooling::DiagnosticMessage &
Message =
Error.Message;
121 SmallVector<std::pair<SourceLocation, bool>, 4> FixLocations;
123 auto Level =
static_cast<DiagnosticsEngine::Level
>(
Error.DiagLevel);
125 if (!
Error.EnabledDiagnosticAliases.empty())
126 Name +=
"," + llvm::join(
Error.EnabledDiagnosticAliases,
",");
127 if (
Error.IsWarningAsError) {
128 Name +=
",-warnings-as-errors";
129 Level = DiagnosticsEngine::Error;
132 auto Diag = Diags.Report(
Loc, Diags.getCustomDiagID(Level,
"%0 [%1]"))
134 for (
const FileByteRange &FBR :
Error.Message.Ranges)
135 Diag << getRange(FBR);
137 const llvm::StringMap<Replacements> *ChosenFix;
140 for (
const auto &FileAndReplacements : *ChosenFix) {
141 for (
const auto &Repl : FileAndReplacements.second) {
143 bool CanBeApplied =
false;
144 if (!Repl.isApplicable())
146 SourceLocation FixLoc;
147 SmallString<128> FixAbsoluteFilePath = Repl.getFilePath();
148 Files.makeAbsolutePath(FixAbsoluteFilePath);
149 tooling::Replacement R(FixAbsoluteFilePath, Repl.getOffset(),
150 Repl.getLength(), Repl.getReplacementText());
151 Replacements &Replacements = FileReplacements[R.getFilePath()];
152 llvm::Error Err = Replacements.add(R);
155 llvm::errs() <<
"Trying to resolve conflict: "
156 << llvm::toString(std::move(Err)) <<
"\n";
158 Replacements.getShiftedCodePosition(R.getOffset());
159 unsigned NewLength = Replacements.getShiftedCodePosition(
160 R.getOffset() + R.getLength()) -
162 if (NewLength == R.getLength()) {
163 R = Replacement(R.getFilePath(), NewOffset, NewLength,
164 R.getReplacementText());
165 Replacements = Replacements.merge(tooling::Replacements(R));
170 <<
"Can't resolve conflict, skipping the replacement.\n";
176 FixLoc = getLocation(FixAbsoluteFilePath, Repl.getOffset());
177 FixLocations.push_back(std::make_pair(FixLoc, CanBeApplied));
181 reportFix(Diag,
Error.Message.Fix);
183 for (
auto Fix : FixLocations) {
184 Diags.Report(
Fix.first,
Fix.second ? diag::note_fixit_applied
185 : diag::note_fixit_failed);
187 for (
const auto &Note :
Error.Notes)
192 if (TotalFixes > 0) {
193 Rewriter Rewrite(SourceMgr, LangOpts);
194 for (
const auto &FileAndReplacements : FileReplacements) {
195 StringRef File = FileAndReplacements.first();
196 llvm::ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer =
197 SourceMgr.getFileManager().getBufferForFile(File);
199 llvm::errs() <<
"Can't get buffer for file " << File <<
": "
200 << Buffer.getError().message() <<
"\n";
204 StringRef
Code = Buffer.get()->getBuffer();
205 auto Style = format::getStyle(
206 *Context.getOptionsForFile(File).FormatStyle, File,
"none");
208 llvm::errs() << llvm::toString(Style.takeError()) <<
"\n";
211 llvm::Expected<tooling::Replacements> Replacements =
212 format::cleanupAroundReplacements(
Code, FileAndReplacements.second,
215 llvm::errs() << llvm::toString(Replacements.takeError()) <<
"\n";
218 if (llvm::Expected<tooling::Replacements> FormattedReplacements =
219 format::formatReplacements(
Code, *Replacements, *Style)) {
220 Replacements = std::move(FormattedReplacements);
222 llvm_unreachable(
"!Replacements");
224 llvm::errs() << llvm::toString(FormattedReplacements.takeError())
225 <<
". Skipping formatting.\n";
227 if (!tooling::applyAllReplacements(Replacements.get(), Rewrite)) {
228 llvm::errs() <<
"Can't apply replacements for file " << File <<
"\n";
231 if (Rewrite.overwriteChangedFiles()) {
232 llvm::errs() <<
"clang-tidy failed to apply suggested fixes.\n";
234 llvm::errs() <<
"clang-tidy applied " << AppliedFixes <<
" of "
235 << TotalFixes <<
" suggested fixes.\n";
240 unsigned getWarningsAsErrorsCount()
const {
return WarningsAsErrors; }
243 SourceLocation getLocation(StringRef FilePath,
unsigned Offset) {
244 if (FilePath.empty())
245 return SourceLocation();
247 auto File = SourceMgr.getFileManager().getFile(FilePath);
249 return SourceLocation();
251 FileID ID = SourceMgr.getOrCreateFileID(*File, SrcMgr::C_User);
252 return SourceMgr.getLocForStartOfFile(ID).getLocWithOffset(
Offset);
255 void reportFix(
const DiagnosticBuilder &Diag,
256 const llvm::StringMap<Replacements> &
Fix) {
257 for (
const auto &FileAndReplacements :
Fix) {
258 for (
const auto &Repl : FileAndReplacements.second) {
259 if (!Repl.isApplicable())
262 FBR.FilePath = Repl.getFilePath().str();
263 FBR.FileOffset = Repl.getOffset();
264 FBR.Length = Repl.getLength();
266 Diag << FixItHint::CreateReplacement(getRange(FBR),
267 Repl.getReplacementText());
272 void reportNote(
const tooling::DiagnosticMessage &Message) {
275 Diags.Report(
Loc, Diags.getCustomDiagID(DiagnosticsEngine::Note,
"%0"))
277 for (
const FileByteRange &FBR :
Message.Ranges)
278 Diag << getRange(FBR);
282 CharSourceRange getRange(
const FileByteRange &Range) {
283 SmallString<128> AbsoluteFilePath{
Range.FilePath};
284 Files.makeAbsolutePath(AbsoluteFilePath);
285 SourceLocation BeginLoc = getLocation(AbsoluteFilePath,
Range.FileOffset);
286 SourceLocation EndLoc = BeginLoc.getLocWithOffset(
Range.Length);
290 return CharSourceRange::getCharRange(BeginLoc, EndLoc);
294 LangOptions LangOpts;
295 IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
297 DiagnosticsEngine Diags;
298 SourceManager SourceMgr;
299 llvm::StringMap<Replacements> FileReplacements;
300 ClangTidyContext &Context;
303 unsigned AppliedFixes;
304 unsigned WarningsAsErrors;
309 ClangTidyASTConsumer(std::vector<std::unique_ptr<ASTConsumer>> Consumers,
310 std::unique_ptr<ClangTidyProfiling> Profiling,
311 std::unique_ptr<ast_matchers::MatchFinder> Finder,
312 std::vector<std::unique_ptr<ClangTidyCheck>> Checks)
314 Profiling(std::move(Profiling)), Finder(std::move(Finder)),
315 Checks(std::move(Checks)) {}
320 std::unique_ptr<ClangTidyProfiling> Profiling;
321 std::unique_ptr<ast_matchers::MatchFinder> Finder;
322 std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
329 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS)
330 : Context(Context), OverlayFS(std::move(OverlayFS)),
332 for (ClangTidyModuleRegistry::entry
E : ClangTidyModuleRegistry::entries()) {
333 std::unique_ptr<ClangTidyModule> Module =
E.instantiate();
334 Module->addCheckFactories(*CheckFactories);
338#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
341 clang::AnalyzerOptions &AnalyzerOptions) {
342 StringRef AnalyzerPrefix(AnalyzerCheckNamePrefix);
343 for (
const auto &Opt : Opts.CheckOptions) {
344 StringRef OptName(Opt.getKey());
345 if (!OptName.consume_front(AnalyzerPrefix))
348 AnalyzerOptions.Config[OptName] = Opt.getValue().Value;
352typedef std::vector<std::pair<std::string, bool>> CheckersList;
354static CheckersList getAnalyzerCheckersAndPackages(ClangTidyContext &Context,
355 bool IncludeExperimental) {
358 const auto &RegisteredCheckers =
359 AnalyzerOptions::getRegisteredCheckers(IncludeExperimental);
360 bool AnalyzerChecksEnabled =
false;
361 for (StringRef CheckName : RegisteredCheckers) {
362 std::string ClangTidyCheckName((AnalyzerCheckNamePrefix + CheckName).str());
363 AnalyzerChecksEnabled |= Context.isCheckEnabled(ClangTidyCheckName);
366 if (!AnalyzerChecksEnabled)
374 for (StringRef CheckName : RegisteredCheckers) {
375 std::string ClangTidyCheckName((AnalyzerCheckNamePrefix + CheckName).str());
377 if (CheckName.startswith(
"core") ||
378 Context.isCheckEnabled(ClangTidyCheckName)) {
379 List.emplace_back(std::string(CheckName),
true);
386std::unique_ptr<clang::ASTConsumer>
388 clang::CompilerInstance &Compiler, StringRef File) {
391 SourceManager *SM = &Compiler.getSourceManager();
392 Context.setSourceManager(SM);
393 Context.setCurrentFile(File);
394 Context.setASTContext(&Compiler.getASTContext());
396 auto WorkingDir = Compiler.getSourceManager()
398 .getVirtualFileSystem()
399 .getCurrentWorkingDirectory();
401 Context.setCurrentBuildDirectory(WorkingDir.get());
403 std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
404 CheckFactories->createChecksForLanguage(&Context);
406 ast_matchers::MatchFinder::MatchFinderOptions FinderOptions;
408 std::unique_ptr<ClangTidyProfiling> Profiling;
409 if (Context.getEnableProfiling()) {
410 Profiling = std::make_unique<ClangTidyProfiling>(
411 Context.getProfileStorageParams());
412 FinderOptions.CheckProfiling.emplace(Profiling->Records);
415 std::unique_ptr<ast_matchers::MatchFinder> Finder(
416 new ast_matchers::MatchFinder(std::move(FinderOptions)));
418 Preprocessor *PP = &Compiler.getPreprocessor();
419 Preprocessor *ModuleExpanderPP = PP;
421 if (Context.getLangOpts().Modules && OverlayFS !=
nullptr) {
422 auto ModuleExpander = std::make_unique<ExpandModularHeadersPPCallbacks>(
423 &Compiler, OverlayFS);
424 ModuleExpanderPP = ModuleExpander->getPreprocessor();
425 PP->addPPCallbacks(std::move(ModuleExpander));
428 for (
auto &Check : Checks) {
429 Check->registerMatchers(&*Finder);
430 Check->registerPPCallbacks(*SM, PP, ModuleExpanderPP);
433 std::vector<std::unique_ptr<ASTConsumer>> Consumers;
435 Consumers.push_back(Finder->newASTConsumer());
437#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
438 AnalyzerOptionsRef AnalyzerOptions = Compiler.getAnalyzerOpts();
439 AnalyzerOptions->CheckersAndPackages = getAnalyzerCheckersAndPackages(
440 Context, Context.canEnableAnalyzerAlphaCheckers());
441 if (!AnalyzerOptions->CheckersAndPackages.empty()) {
442 setStaticAnalyzerCheckerOpts(Context.getOptions(), *AnalyzerOptions);
443 AnalyzerOptions->AnalysisDiagOpt = PD_NONE;
444 AnalyzerOptions->eagerlyAssumeBinOpBifurcation =
true;
445 std::unique_ptr<ento::AnalysisASTConsumer> AnalysisConsumer =
446 ento::CreateAnalysisConsumer(Compiler);
447 AnalysisConsumer->AddDiagnosticConsumer(
448 new AnalyzerDiagnosticConsumer(Context));
449 Consumers.push_back(std::move(AnalysisConsumer));
452 return std::make_unique<ClangTidyASTConsumer>(
453 std::move(Consumers), std::move(Profiling), std::move(Finder),
458 std::vector<std::string> CheckNames;
459 for (
const auto &CheckFactory : *CheckFactories) {
460 if (Context.isCheckEnabled(CheckFactory.getKey()))
461 CheckNames.emplace_back(CheckFactory.getKey());
464#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
465 for (
const auto &AnalyzerCheck : getAnalyzerCheckersAndPackages(
466 Context, Context.canEnableAnalyzerAlphaCheckers()))
467 CheckNames.push_back(AnalyzerCheckNamePrefix + AnalyzerCheck.first);
470 llvm::sort(CheckNames);
476 std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
477 CheckFactories->createChecks(&Context);
478 for (
const auto &Check : Checks)
479 Check->storeOptions(Options);
483std::vector<std::string>
505std::vector<ClangTidyError>
507 const CompilationDatabase &Compilations,
508 ArrayRef<std::string> InputFiles,
509 llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> BaseFS,
512 ClangTool Tool(Compilations, InputFiles,
513 std::make_shared<PCHContainerOperations>(), BaseFS);
516 ArgumentsAdjuster PerFileExtraArgumentsInserter =
517 [&Context](
const CommandLineArguments &
Args, StringRef
Filename) {
519 CommandLineArguments AdjustedArgs =
Args;
520 if (Opts.ExtraArgsBefore) {
521 auto I = AdjustedArgs.begin();
522 if (I != AdjustedArgs.end() && !StringRef(*I).startswith(
"-"))
524 AdjustedArgs.insert(I, Opts.ExtraArgsBefore->begin(),
525 Opts.ExtraArgsBefore->end());
528 AdjustedArgs.insert(AdjustedArgs.end(), Opts.ExtraArgs->begin(),
529 Opts.ExtraArgs->end());
533 Tool.appendArgumentsAdjuster(PerFileExtraArgumentsInserter);
534 Tool.appendArgumentsAdjuster(getStripPluginsAdjuster());
539 DiagnosticsEngine DE(
new DiagnosticIDs(),
new DiagnosticOptions(),
540 &DiagConsumer,
false);
541 Context.setDiagnosticsEngine(&DE);
542 Tool.setDiagnosticConsumer(&DiagConsumer);
547 IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> BaseFS)
548 : ConsumerFactory(Context, std::move(BaseFS)) {}
549 std::unique_ptr<FrontendAction> create()
override {
550 return std::make_unique<Action>(&ConsumerFactory);
553 bool runInvocation(std::shared_ptr<CompilerInvocation> Invocation,
555 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
558 Invocation->getPreprocessorOpts().SetUpStaticAnalyzer =
true;
559 return FrontendActionFactory::runInvocation(
560 Invocation, Files, PCHContainerOps, DiagConsumer);
564 class Action :
public ASTFrontendAction {
567 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &Compiler,
568 StringRef File)
override {
579 ActionFactory Factory(Context, std::move(BaseFS));
581 return DiagConsumer.
take();
586 unsigned &WarningsAsErrorsCount,
587 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) {
588 ErrorReporter Reporter(Context,
Fix, std::move(BaseFS));
589 llvm::vfs::FileSystem &FileSystem =
590 Reporter.getSourceManager().getFileManager().getVirtualFileSystem();
591 auto InitialWorkingDir = FileSystem.getCurrentWorkingDirectory();
592 if (!InitialWorkingDir)
593 llvm::report_fatal_error(
"Cannot get current working path.");
596 if (!
Error.BuildDirectory.empty()) {
601 FileSystem.setCurrentWorkingDirectory(
Error.BuildDirectory);
603 Reporter.reportDiagnostic(
Error);
605 FileSystem.setCurrentWorkingDirectory(InitialWorkingDir.get());
608 WarningsAsErrorsCount += Reporter.getWarningsAsErrorsCount();
612 const std::vector<ClangTidyError> &Errors,
614 TranslationUnitDiagnostics TUD;
615 TUD.MainSourceFile = std::string(MainFilePath);
616 for (
const auto &
Error : Errors) {
617 tooling::Diagnostic Diag =
Error;
618 TUD.Diagnostics.insert(TUD.Diagnostics.end(), Diag);
621 yaml::Output YAML(
OS);
634 for (
const ClangTidyModuleRegistry::entry &Module :
635 ClangTidyModuleRegistry::entries()) {
636 Module.instantiate()->addCheckFactories(Factories);
639 for (
const auto &Factory : Factories)
640 Result.Names.insert(Factory.getKey());
642#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
643 SmallString<64> Buffer(AnalyzerCheckNamePrefix);
644 size_t DefSize = Buffer.size();
645 for (
const auto &AnalyzerCheck : AnalyzerOptions::getRegisteredCheckers(
647 Buffer.truncate(DefSize);
648 Buffer.append(AnalyzerCheck);
649 Result.Names.insert(Buffer);
653 Context.setOptionsCollector(&Result.Options);
654 for (
const auto &Factory : Factories) {
655 Factory.getValue()(Factory.getKey(), &Context);
static cl::opt< bool > EnableCheckProfile("enable-check-profile", desc(R"(
Enable per-check timing profiles, and print a
report to stderr.
)"), cl::init(false), cl::cat(ClangTidyCategory))
static cl::opt< bool > Fix("fix", 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))
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.
static cl::opt< std::string > StoreCheckProfile("store-check-profile", 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))
static constexpr llvm::SourceMgr::DiagKind Error
CharSourceRange Range
SourceRange for the file name.
std::string Filename
Filename as a string.
llvm::raw_string_ostream OS
std::unique_ptr< clang::ASTConsumer > createASTConsumer(clang::CompilerInstance &Compiler, StringRef File)
Returns an ASTConsumer that runs the specified clang-tidy checks.
ClangTidyOptions::OptionMap getCheckOptions()
Get the union of options from all checks.
ClangTidyASTConsumerFactory(ClangTidyContext &Context, IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS=nullptr)
std::vector< std::string > getCheckNames()
Get the list of enabled checks.
A collection of ClangTidyCheckFactory instances.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
A diagnostic consumer that turns each Diagnostic into a SourceManager-independent ClangTidyError.
std::vector< ClangTidyError > take()
void reportDiagnostic(DiagnosticBuilder D, const T *Node, SourceRange SR, bool DefaultConstruction)
constexpr llvm::StringLiteral Message
const llvm::StringMap< tooling::Replacements > * getFixIt(const tooling::Diagnostic &Diagnostic, bool GetFixFromNotes)
Gets the Fix attached to Diagnostic.
llvm::Registry< ClangTidyModule > ClangTidyModuleRegistry
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.
FixBehaviour
Controls what kind of fixes clang-tidy is allowed to apply.
@ FB_NoFix
Don't try to apply any fix.
@ FB_FixNotes
Apply fixes found in notes.
ClangTidyOptions::OptionMap getCheckOptions(const ClangTidyOptions &Options, bool AllowEnablingAnalyzerAlphaCheckers)
Returns the effective check-specific options.
void handleErrors(llvm::ArrayRef< ClangTidyError > Errors, ClangTidyContext &Context, FixBehaviour Fix, unsigned &WarningsAsErrorsCount, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS)
Displays the found Errors to the users.
std::vector< ClangTidyError > runClangTidy(clang::tidy::ClangTidyContext &Context, const CompilationDatabase &Compilations, ArrayRef< std::string > InputFiles, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > BaseFS, bool ApplyAnyFix, bool EnableCheckProfile, llvm::StringRef StoreCheckProfile)
NamesAndOptions getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers)
void exportReplacements(const llvm::StringRef MainFilePath, const std::vector< ClangTidyError > &Errors, raw_ostream &OS)
Some operations such as code completion produce a set of candidates.
A detected error complete with information to display diagnostic and automatic fix.
Contains options for clang-tidy.
llvm::StringMap< ClangTidyValue > OptionMap