[analyzer] Generalize bitwise OR rules for ranges
authorValeriy Savchenko <vsavchenko@apple.com>
Mon, 4 May 2020 16:44:43 +0000 (19:44 +0300)
committerValeriy Savchenko <vsavchenko@apple.com>
Thu, 28 May 2020 15:55:22 +0000 (18:55 +0300)
commit47c4b8bd68698b1827f39c3056783ed042faf718
tree96de2a86e57318a6ea08b83eba5af3c00420f2e7
parent1f57d76a8dd00611aaa4b33048be195ea9a2dc44
[analyzer] Generalize bitwise OR rules for ranges

Summary:
Previously the current solver started reasoning about bitwise OR
expressions only when one of the operands is a constant.  However,
very similar logic could be applied to ranges.  This commit addresses
this shortcoming.  Additionally, it refines how we deal with negative
operands.

Differential Revision: https://reviews.llvm.org/D79336
clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
clang/test/Analysis/constant-folding.c