[analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock
authorKristóf Umann <dkszelethus@gmail.com>
Tue, 25 Aug 2020 11:49:41 +0000 (13:49 +0200)
committerKristóf Umann <dkszelethus@gmail.com>
Tue, 15 Sep 2020 14:55:44 +0000 (16:55 +0200)
Differential Revision: https://reviews.llvm.org/D86532

clang/docs/analyzer/checkers.rst
clang/docs/analyzer/user-docs/CrossTranslationUnit.rst

index 7a294f9..9fb6782 100644 (file)
@@ -1491,6 +1491,23 @@ Warn about assigning non-{0,1} values to boolean variables.
 alpha.core
 ^^^^^^^^^^
 
+.. _alpha-core-C11Lock:
+
+alpha.core.C11Lock
+""""""""""""""""""
+Similarly to :ref:`alpha.unix.PthreadLock <alpha-unix-PthreadLock>`, checks for
+the locking/unlocking of ``mtx_t`` mutexes.
+
+.. code-block:: cpp
+
+ mtx_t mtx1;
+
+ void bad1(void)
+ {
+   mtx_lock(&mtx1);
+   mtx_lock(&mtx1); // warn: This lock has already been acquired
+ }
+
 .. _alpha-core-CallAndMessageUnInitRefArg:
 
 alpha.core.CallAndMessageUnInitRefArg (C,C++, ObjC)
@@ -1868,6 +1885,26 @@ Check for dereference of null smart pointers.
    *P; // warn: dereference of a default constructed smart unique_ptr
  }
 
+alpha.fuchsia
+^^^^^^^^^^^^^
+
+.. _alpha-fuchsia-lock:
+
+alpha.fuchsia.Lock
+""""""""""""""""""
+Similarly to :ref:`alpha.unix.PthreadLock <alpha-unix-PthreadLock>`, checks for
+the locking/unlocking of fuchsia mutexes.
+
+.. code-block:: cpp
+
+ spin_lock_t mtx1;
+
+ void bad1(void)
+ {
+   spin_lock(&mtx1);
+   spin_lock(&mtx1);   // warn: This lock has already been acquired
+ }
+
 alpha.llvm
 ^^^^^^^^^^
 
index 36be82f..0606185 100644 (file)
@@ -201,6 +201,8 @@ Example usage of scan-build-py:
   ^C
   $
 
+.. _ctu-on-demand:
+
 On-demand analysis
 __________________
 The analysis produces the necessary AST structure of external TUs during analysis. This requires the