Skip to content

Commit 9b46b24

Browse files
davidrohrktf
authored andcommitted
Bump to Clang 13
1 parent d41ae76 commit 9b46b24

File tree

4 files changed

+128
-217
lines changed

4 files changed

+128
-217
lines changed

ClangTidy.h

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,28 @@ runClangTidy(clang::tidy::ClangTidyContext &Context,
7979
const tooling::CompilationDatabase &Compilations,
8080
ArrayRef<std::string> InputFiles,
8181
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> BaseFS,
82-
bool EnableCheckProfile = false,
82+
bool ApplyAnyFix, bool EnableCheckProfile = false,
8383
llvm::StringRef StoreCheckProfile = StringRef());
8484

85+
/// Controls what kind of fixes clang-tidy is allowed to apply.
86+
enum FixBehaviour {
87+
/// Don't try to apply any fix.
88+
FB_NoFix,
89+
/// Only apply fixes added to warnings.
90+
FB_Fix,
91+
/// Apply fixes found in notes.
92+
FB_FixNotes
93+
};
94+
8595
// FIXME: This interface will need to be significantly extended to be useful.
8696
// FIXME: Implement confidence levels for displaying/fixing errors.
8797
//
88-
/// Displays the found \p Errors to the users. If \p Fix is true, \p
89-
/// Errors containing fixes are automatically applied and reformatted. If no
90-
/// clang-format configuration file is found, the given \P FormatStyle is used.
98+
/// Displays the found \p Errors to the users. If \p Fix is \ref FB_Fix or \ref
99+
/// FB_FixNotes, \p Errors containing fixes are automatically applied and
100+
/// reformatted. If no clang-format configuration file is found, the given \P
101+
/// FormatStyle is used.
91102
void handleErrors(llvm::ArrayRef<ClangTidyError> Errors,
92-
ClangTidyContext &Context, bool Fix,
103+
ClangTidyContext &Context, FixBehaviour Fix,
93104
unsigned &WarningsAsErrorsCount,
94105
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS);
95106

0 commit comments

Comments
 (0)