[clang] a93ff18 - [Analyzer][NFC] Remove prefix from WebKitNoUncountedMemberChecker name
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 15 14:14:13 PDT 2020
Author: Jan Korous
Date: 2020-06-15T14:13:56-07:00
New Revision: a93ff1826b4bfd1674ea99dd45609b9e07792f6c
URL: https://github.com/llvm/llvm-project/commit/a93ff1826b4bfd1674ea99dd45609b9e07792f6c
DIFF: https://github.com/llvm/llvm-project/commit/a93ff1826b4bfd1674ea99dd45609b9e07792f6c.diff
LOG: [Analyzer][NFC] Remove prefix from WebKitNoUncountedMemberChecker name
Added:
Modified:
clang/docs/analyzer/checkers.rst
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp
clang/test/Analysis/Checkers/WebKit/uncounted-members-regression-46142.cpp
clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
Removed:
################################################################################
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index 7fb5719c7815..d14bd2d68af9 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -1404,9 +1404,9 @@ Ref-counted types hold their ref-countable data by a raw pointer and allow impli
struct Derived : RefCntblBase { }; // warn
-.. _webkit-WebKitNoUncountedMemberChecker:
+.. _webkit-NoUncountedMemberChecker:
-webkit.WebKitNoUncountedMemberChecker
+webkit.NoUncountedMemberChecker
"""""""""""""""""""""""""""""""""""""
Raw pointers and references to uncounted types can't be used as class members. Only ref-counted types are allowed.
@@ -2404,7 +2404,7 @@ Here are some examples of situations that we warn about as they *might* be poten
consume(uncounted); // warn
}
-Although we are enforcing member variables to be ref-counted by `webkit.WebKitNoUncountedMemberChecker` any method of the same class still has unrestricted access to these. Since from a caller's perspective we can't guarantee a particular member won't get modified by callee (directly or indirectly) we don't consider values obtained from members safe.
+Although we are enforcing member variables to be ref-counted by `webkit.NoUncountedMemberChecker` any method of the same class still has unrestricted access to these. Since from a caller's perspective we can't guarantee a particular member won't get modified by callee (directly or indirectly) we don't consider values obtained from members safe.
Note: It's likely this heuristic could be made more precise with fewer false positives - for example calls to free functions that don't have any parameter other than the pointer should be safe as the callee won't be able to tamper with the member unless it's a global variable.
diff --git a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
index 23bc0e1dbd4d..9de324506bf6 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+++ b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
@@ -1625,7 +1625,7 @@ def RefCntblBaseVirtualDtorChecker : Checker<"RefCntblBaseVirtualDtor">,
HelpText<"Check for any ref-countable base class having virtual destructor.">,
Documentation<HasDocumentation>;
-def WebKitNoUncountedMemberChecker : Checker<"WebKitNoUncountedMemberChecker">,
+def NoUncountedMemberChecker : Checker<"NoUncountedMemberChecker">,
HelpText<"Check for no uncounted member variables.">,
Documentation<HasDocumentation>;
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp
index 2deefab96255..3956db933b35 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp
@@ -145,11 +145,11 @@ class NoUncountedMemberChecker
};
} // namespace
-void ento::registerWebKitNoUncountedMemberChecker(CheckerManager &Mgr) {
+void ento::registerNoUncountedMemberChecker(CheckerManager &Mgr) {
Mgr.registerChecker<NoUncountedMemberChecker>();
}
-bool ento::shouldRegisterWebKitNoUncountedMemberChecker(
+bool ento::shouldRegisterNoUncountedMemberChecker(
const CheckerManager &Mgr) {
return true;
}
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-members-regression-46142.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-members-regression-46142.cpp
index 20e58e7926d8..94ddcaca0817 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-members-regression-46142.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-members-regression-46142.cpp
@@ -1,6 +1,6 @@
// regression test for https://bugs.llvm.org/show_bug.cgi?id=46142
-// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.WebKitNoUncountedMemberChecker -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s
// expected-no-diagnostics
class ClassWithoutADefinition;
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
index e88c0b3b0dd0..a0ea61e0e2a1 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.WebKitNoUncountedMemberChecker -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s
#include "mock-types.h"
More information about the cfe-commits
mailing list