summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2015-08-19 22:21:37 +0000
committerAlexander Kornienko <alexfh@google.com>2015-08-19 22:21:37 +0000
commit1b7bf7a2a7a75e4fa934b923e387d1285447bbf3 (patch)
tree9cf72cacb75461b69cab554c34ba9d7e70e873bd /clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h
parent8d90e533ea1ae3af604fe9c39e7b9e3d49ecd3ce (diff)
downloadbcm5719-llvm-1b7bf7a2a7a75e4fa934b923e387d1285447bbf3.tar.gz
bcm5719-llvm-1b7bf7a2a7a75e4fa934b923e387d1285447bbf3.zip
[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
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h
new file mode 100644
index 00000000000..40b90939ea4
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h
@@ -0,0 +1,34 @@
+//===--- UseNullptrCheck.h - clang-tidy--------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
+
+#include "../ClangTidy.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class UseNullptrCheck : public ClangTidyCheck {
+public:
+ UseNullptrCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ SmallVector<StringRef, 1> NullMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
OpenPOWER on IntegriCloud