gecko-dev/build/build-clang/clang-tidy-ci.patch
Andi-Bogdan Postelnicu 5392090016 Bug 1589096 - add registerPPCallbacks to our version of clang-tidy due to a limitation in mozilla-must-override. r=sylvestre
In the future we should re-write this checker but for now this solution is acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D51242

--HG--
extra : moz-landing-system : lando
2019-10-31 12:16:35 +00:00

27 lines
1.2 KiB
Diff

diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index 1d813d65f8d..5ef2e6fe9cd 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -407,6 +407,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
for (auto &Check : Checks) {
Check->registerMatchers(&*Finder);
+ Check->registerPPCallbacks(Compiler);
Check->registerPPCallbacks(*SM, PP, ModuleExpanderPP);
}
diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.h b/clang-tools-extra/clang-tidy/ClangTidyCheck.h
index 3064a41caa1..9c7eb4815c4 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyCheck.h
+++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.h
@@ -53,6 +53,9 @@ public:
/// constructor using the Options.get() methods below.
ClangTidyCheck(StringRef CheckName, ClangTidyContext *Context);
+ /// This has been deprecated in clang 9 - needed by mozilla-must-override
+ virtual void registerPPCallbacks(CompilerInstance &Compiler) {}
+
/// \brief Override this to register ``PPCallbacks`` in the preprocessor.
///
/// This should be used for clang-tidy checks that analyze preprocessor-