Skip to content

Commit

Permalink
Revert "[Analyzer][WebKit] RefCntblBaseVirtualDtorChecker"
Browse files Browse the repository at this point in the history
This reverts commit f7c7e8a.
Breaks build everywhere.
  • Loading branch information
nico committed May 21, 2020
1 parent f8b4412 commit 1108f5c
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 669 deletions.
27 changes: 0 additions & 27 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1374,33 +1374,6 @@ double freed, or use after freed. This check attempts to find such problems.
zx_handle_close(sb);
}
WebKit
^^^^^^
WebKit is an open-source web browser engine available for macOS, iOS and Linux.
This section describes checkers that can find issues in WebKit codebase.
Most of the checkers focus on memory management for which WebKit uses custom implementation of reference counted smartpointers.
Checker are formulated in terms related to ref-counting:
* *Ref-counted type* is either ``Ref<T>`` or ``RefPtr<T>``.
* *Ref-countable type* is any type that implements ``ref()`` and ``deref()`` methods as ``RefPtr<>`` is a template (i. e. relies on duck typing).
* *Uncounted type* is ref-countable but not ref-counted type.
.. _webkit-WebKitRefCntblBaseVirtualDtor:
webkit.WebKitRefCntblBaseVirtualDtor
""""""""""""""""""""""""""""""""""""
All uncounted types used as base classes must have a virtual destructor.
Ref-counted types hold their ref-countable data by a raw pointer and allow implicit upcasting from ref-counted pointer to derived type to ref-counted pointer to base type. This might lead to an object of (dynamic) derived type being deleted via pointer to the base class type which C++ standard defines as UB in case the base class doesn't have virtual destructor ``[expr.delete]``.
.. code-block:: cpp
struct RefCntblBase {
void ref() {}
void deref() {}
};
struct Derived : RefCntblBase { }; // warn
.. _alpha-checkers:
Expand Down
13 changes: 0 additions & 13 deletions clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ def NonDeterminismAlpha : Package<"nondeterminism">, ParentPackage<Alpha>;
def Fuchsia : Package<"fuchsia">;
def FuchsiaAlpha : Package<"fuchsia">, ParentPackage<Alpha>;

def WebKit : Package<"webkit">;
def WebKitAlpha : Package<"webkit">, ParentPackage<Alpha>;

//===----------------------------------------------------------------------===//
// Core Checkers.
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1623,13 +1620,3 @@ def FuchsiaLockChecker : Checker<"Lock">,

} // end fuchsia

//===----------------------------------------------------------------------===//
// WebKit checkers.
//===----------------------------------------------------------------------===//

let ParentPackage = WebKit in {

def WebKitRefCntblBaseVirtualDtorChecker : Checker<"WebKitRefCntblBaseVirtualDtor">,
HelpText<"Check for any ref-countable base class having virtual destructor.">,
Documentation<HasDocumentation>;
} // end webkit
2 changes: 0 additions & 2 deletions clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ add_clang_library(clangStaticAnalyzerCheckers
VLASizeChecker.cpp
ValistChecker.cpp
VirtualCallChecker.cpp
WebKit/PtrTypesSemantics.cpp
WebKit/RefCntblBaseVirtualDtorChecker.cpp

LINK_LIBS
clangAST
Expand Down
70 changes: 0 additions & 70 deletions clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.h

This file was deleted.

28 changes: 0 additions & 28 deletions clang/lib/StaticAnalyzer/Checkers/WebKit/DiagOutputUtils.h

This file was deleted.

172 changes: 0 additions & 172 deletions clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp

This file was deleted.

59 changes: 0 additions & 59 deletions clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h

This file was deleted.

Loading

0 comments on commit 1108f5c

Please sign in to comment.