From 1b7bf7a2a7a75e4fa934b923e387d1285447bbf3 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Wed, 19 Aug 2015 22:21:37 +0000 Subject: [clang-tidy] Add modernize-use-nullptr check, attempt 2. This patch re-applies r245434 and r245471 reverted in r245493, and changes the way custom null macros are configured. The test for custom null macros is temporarily excluded and will be committed separately to reduce chances of breakages. Initial patches by Angel Garcia. llvm-svn: 245511 --- clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp') diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp index 962245b2a08..a1b80ffb581 100644 --- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp @@ -12,6 +12,7 @@ #include "../ClangTidyModuleRegistry.h" #include "LoopConvertCheck.h" #include "PassByValueCheck.h" +#include "UseNullptrCheck.h" using namespace clang::ast_matchers; @@ -24,6 +25,7 @@ public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { CheckFactories.registerCheck("modernize-loop-convert"); CheckFactories.registerCheck("modernize-pass-by-value"); + CheckFactories.registerCheck("modernize-use-nullptr"); } ClangTidyOptions getModuleOptions() override { @@ -31,6 +33,9 @@ public: auto &Opts = Options.CheckOptions; Opts["modernize-loop-convert.MinConfidence"] = "reasonable"; Opts["modernize-pass-by-value.IncludeStyle"] = "llvm"; // Also: "google". + + // Comma-separated list of macros that behave like NULL. + Opts["modernize-use-nullptr.NullMacros"] = "NULL"; return Options; } }; -- cgit v1.2.3