Skip to content

Commit 1a8e450

Browse files
committed
[analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock
1 parent 274bb3f commit 1a8e450

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

clang/docs/analyzer/checkers.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,23 @@ Warn about assigning non-{0,1} values to boolean variables.
14721472
alpha.core
14731473
^^^^^^^^^^
14741474
1475+
.. _alpha-core-C11Lock:
1476+
1477+
alpha.core.C11Lock
1478+
""""""""""""""""""
1479+
Similarly to :ref:`alpha.unix.PthreadLock <alpha-unix-PthreadLock>`, checks for
1480+
the locking/unlocking of ``mtx_t`` mutexes.
1481+
1482+
.. code-block:: cpp
1483+
1484+
mtx_t mtx1;
1485+
1486+
void bad1(void)
1487+
{
1488+
mtx_lock(&mtx1);
1489+
mtx_lock(&mtx1); // warn: This lock has already been acquired
1490+
}
1491+
14751492
.. _alpha-core-CallAndMessageUnInitRefArg:
14761493
14771494
alpha.core.CallAndMessageUnInitRefArg (C,C++, ObjC)
@@ -1849,6 +1866,26 @@ Check for dereference of null smart pointers.
18491866
*P; // warn: dereference of a default constructed smart unique_ptr
18501867
}
18511868
1869+
alpha.fuchsia
1870+
^^^^^^^^^^^^^
1871+
1872+
.. _alpha-fuchsia-lock:
1873+
1874+
alpha.fuchsia.Lock
1875+
""""""""""""""""""
1876+
Similarly to :ref:`alpha.unix.PthreadLock <alpha-unix-PthreadLock>`, checks for
1877+
the locking/unlocking of fuchsia mutexes.
1878+
1879+
.. code-block:: cpp
1880+
1881+
spin_lock_t mtx1;
1882+
1883+
void bad1(void)
1884+
{
1885+
spin_lock(&mtx1);
1886+
spin_lock(&mtx1); // warn: This lock has already been acquired
1887+
}
1888+
18521889
alpha.llvm
18531890
^^^^^^^^^^
18541891

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ Example usage of scan-build-py:
201201
^C
202202
$
203203
204+
.. _ctu-on-demand:
205+
204206
On-demand analysis
205207
__________________
206208
The analysis produces the necessary AST structure of external TUs during analysis. This requires the

0 commit comments

Comments
 (0)