summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/docs/analyzer
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
committerpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
commitbd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch)
tree309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/tools/clang/docs/analyzer
parentkillp -a should not kill the window if only one pane. (diff)
downloadwireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz
wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/clang/docs/analyzer')
-rw-r--r--gnu/llvm/tools/clang/docs/analyzer/DebugChecks.rst35
-rw-r--r--gnu/llvm/tools/clang/docs/analyzer/conf.py7
2 files changed, 39 insertions, 3 deletions
diff --git a/gnu/llvm/tools/clang/docs/analyzer/DebugChecks.rst b/gnu/llvm/tools/clang/docs/analyzer/DebugChecks.rst
index 771e39fc439..bfa3142efbd 100644
--- a/gnu/llvm/tools/clang/docs/analyzer/DebugChecks.rst
+++ b/gnu/llvm/tools/clang/docs/analyzer/DebugChecks.rst
@@ -162,6 +162,41 @@ ExprInspection checks
} while(0); // expected-warning{{SYMBOL DEAD}}
+- void clang_analyzer_explain(a single argument of any type);
+
+ This function explains the value of its argument in a human-readable manner
+ in the warning message. You can make as many overrides of its prototype
+ in the test code as necessary to explain various integral, pointer,
+ or even record-type values.
+
+ Example usage::
+
+ void clang_analyzer_explain(int);
+ void clang_analyzer_explain(void *);
+
+ void foo(int param, void *ptr) {
+ clang_analyzer_explain(param); // expected-warning{{argument 'param'}}
+ if (!ptr)
+ clang_analyzer_explain(ptr); // expected-warning{{memory address '0'}}
+ }
+
+- size_t clang_analyzer_getExtent(void *);
+
+ This function returns the value that represents the extent of a memory region
+ pointed to by the argument. This value is often difficult to obtain otherwise,
+ because no valid code that produces this value. However, it may be useful
+ for testing purposes, to see how well does the analyzer model region extents.
+
+ Example usage::
+
+ void foo() {
+ int x, *y;
+ size_t xs = clang_analyzer_getExtent(&x);
+ clang_analyzer_explain(xs); // expected-warning{{'4'}}
+ size_t ys = clang_analyzer_getExtent(&y);
+ clang_analyzer_explain(ys); // expected-warning{{'8'}}
+ }
+
Statistics
==========
diff --git a/gnu/llvm/tools/clang/docs/analyzer/conf.py b/gnu/llvm/tools/clang/docs/analyzer/conf.py
index 1514708c0d5..afbfbee6f37 100644
--- a/gnu/llvm/tools/clang/docs/analyzer/conf.py
+++ b/gnu/llvm/tools/clang/docs/analyzer/conf.py
@@ -12,6 +12,7 @@
# serve to show the default.
import sys, os
+from datetime import date
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -41,16 +42,16 @@ master_doc = 'index'
# General information about the project.
project = u'Clang Static Analyzer'
-copyright = u'2013-2014, Analyzer Team'
+copyright = u'2013-%d, Analyzer Team' % date.today().year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '3.4'
+version = '3.9'
# The full version, including alpha/beta/rc tags.
-release = '3.4'
+release = '3.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.