[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 5 Oct 2016 08:28:25 +0000 (08:28 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 5 Oct 2016 08:28:25 +0000 (08:28 +0000)
commit9cb5614c29ec4e53191af3ec0f212a66f9dfd788
tree06500c4ba5f004eccbe990395e36d618bf239176
parent0c33406aaacf7451a43255c337bbf357b6fc730d
[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.

Logical short-circuit operators now act like other branch conditions.

If the symbolic value of the left-hand side is not known to be true or false
(based on the previous execution path), the "Assuming" event piece is added
in order to explain that the analyzer is adding a new assumption.

Additionally, when the assumption is made against the right-hand side of
the logical operator (i.e. when the operator itself acts as a condition
in another CFG terminator), the "Assuming..." piece is written out for the
right-hand side of the operator rather than for the whole operator.
This allows expression-specific diagnostic message text to be constructed.

Differential Revision: https://reviews.llvm.org/D25092

llvm-svn: 283302
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/test/Analysis/conditional-path-notes.c
clang/test/Analysis/edges-new.mm