aboutsummaryrefslogtreecommitdiff
path: root/clang/docs
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-09-25 23:50:53 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-09-25 23:50:53 +0000
commite527df03c44d2ea14b68865a96690008ae2a7960 (patch)
tree8bc05801d2977baddc4fcd150e11cd5b86b0423c /clang/docs
parent8dfcd83371503362acca50f173ee31a749f4dd72 (diff)
[analyzer] Add a testing facility for testing relationships between symbols.
Tests introduced in r329780 was disabled in r342317 because these tests were accidentally testing dump infrastructure, when all they cared about was how symbols relate to each other. So when dump infrastructure changed, tests became annoying to maintain. Add a new feature to ExprInspection: clang_analyzer_denote() and clang_analyzer_explain(). The former adds a notation to a symbol, the latter expresses another symbol in terms of previously denoted symbols. It's currently a bit wonky - doesn't print parentheses and only supports denoting atomic symbols. But it's even more readable that way. Differential Revision: https://reviews.llvm.org/D52133 llvm-svn: 343048
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/analyzer/DebugChecks.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/docs/analyzer/DebugChecks.rst b/clang/docs/analyzer/DebugChecks.rst
index 67521b82cabc..7b192f65224f 100644
--- a/clang/docs/analyzer/DebugChecks.rst
+++ b/clang/docs/analyzer/DebugChecks.rst
@@ -255,6 +255,23 @@ ExprInspection checks
clang_analyzer_hashDump(x); // expected-warning{{hashed string for x}}
}
+- ``void clang_analyzer_denote(int, const char *);``
+
+ Denotes symbols with strings. A subsequent call to clang_analyzer_express()
+ will expresses another symbol in terms of these string. Useful for testing
+ relationships between different symbols.
+
+ Example usage::
+
+ void foo(int x) {
+ clang_analyzer_denote(x, "$x");
+ clang_analyzer_express(x + 1); // expected-warning{{$x + 1}}
+ }
+
+- ``void clang_analyzer_express(int);``
+
+ See clang_analyzer_denote().
+
Statistics
==========