[analyzer] Add a testing facility for testing relationships between symbols.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 25 Sep 2018 23:50:53 +0000 (23:50 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 25 Sep 2018 23:50:53 +0000 (23:50 +0000)
commite527df03c44d2ea14b68865a96690008ae2a7960
tree8bc05801d2977baddc4fcd150e11cd5b86b0423c
parent8dfcd83371503362acca50f173ee31a749f4dd72
[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
clang/docs/analyzer/DebugChecks.rst
clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
clang/test/Analysis/expr-inspection.cpp [new file with mode: 0644]
clang/test/Analysis/svalbuilder-rearrange-comparisons.c