summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-13 08:04:11 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-13 08:04:11 +0000
commite7be4a004b8a0c26841e3726f201e132187db1fe (patch)
treefca6bd8ed728a1d9275709a4fa9aa9a56a514101 /clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
parentac75bca1eb169c2d13b88e33440dec3df589f964 (diff)
downloadbcm5719-llvm-e7be4a004b8a0c26841e3726f201e132187db1fe.tar.gz
bcm5719-llvm-e7be4a004b8a0c26841e3726f201e132187db1fe.zip
[clang-tidy] Add check for redundant function pointer dereferences
Reviewers: alexfh, aaron.ballman, hokein Subscribers: mgorny, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D27520 llvm-svn: 289524
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h')
-rw-r--r--clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h b/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
new file mode 100644
index 00000000000..4cf6d1128b6
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
@@ -0,0 +1,35 @@
+//===--- RedundantFunctionPtrDereferenceCheck.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_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
+
+#include "../ClangTidy.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Eliminate redundant dereferences of a function pointer.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-function-ptr-dereference.html
+class RedundantFunctionPtrDereferenceCheck : public ClangTidyCheck {
+public:
+ RedundantFunctionPtrDereferenceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
OpenPOWER on IntegriCloud