[all-commits] [llvm/llvm-project] bb2ae7: [analyzer] Merge implementations of SymInt, IntSym...

Valeriy Savchenko via All-commits all-commits at lists.llvm.org
Thu May 28 08:57:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bb2ae74717a25ba268e7bd17a2a572d931ed094e
      https://github.com/llvm/llvm-project/commit/bb2ae74717a25ba268e7bd17a2a572d931ed094e
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
    M clang/lib/StaticAnalyzer/Core/SymbolManager.cpp

  Log Message:
  -----------
  [analyzer] Merge implementations of SymInt, IntSym, and SymSym exprs

Summary:
SymIntExpr, IntSymExpr, and SymSymExpr share a big portion of logic
that used to be duplicated across all three classes.  New
implementation also adds an easy way of introducing another type of
operands into the mix.

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


  Commit: 1f57d76a8dd00611aaa4b33048be195ea9a2dc44
      https://github.com/llvm/llvm-project/commit/1f57d76a8dd00611aaa4b33048be195ea9a2dc44
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    M clang/test/Analysis/constant-folding.c
    A clang/test/Analysis/double-ranges-bug.c

  Log Message:
  -----------
  [analyzer] Refactor range inference for symbolic expressions

Summary:
This change introduces a new component to unite all of the reasoning
we have about operations on ranges in the analyzer's solver.
In many cases, we might conclude that the range for a symbolic operation
is much more narrow than the type implies.  While reasoning about
runtime conditions (especially in loops), we need to support more and
more of those little pieces of logic.  The new component mostly plays
a role of an organizer for those, and allows us to focus on the actual
reasoning about ranges and not dispatching manually on the types of the
nested symbolic expressions.

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


  Commit: 47c4b8bd68698b1827f39c3056783ed042faf718
      https://github.com/llvm/llvm-project/commit/47c4b8bd68698b1827f39c3056783ed042faf718
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    M clang/test/Analysis/constant-folding.c

  Log Message:
  -----------
  [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


  Commit: 2a09daff0f902e70a08f2b30f3461fb8848f5ab1
      https://github.com/llvm/llvm-project/commit/2a09daff0f902e70a08f2b30f3461fb8848f5ab1
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    M clang/test/Analysis/constant-folding.c
    M clang/test/Analysis/switch-case.c
    A clang/test/Analysis/uninit-exhaustive-switch-bug.c

  Log Message:
  -----------
  [analyzer] Generalize bitwise AND rules for ranges

Summary:
Previously the current solver started reasoning about bitwise AND
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.

rdar://problem/54359410

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


  Commit: 73c120a9895a7e12e3c29a755d64096c8bd0220f
      https://github.com/llvm/llvm-project/commit/73c120a9895a7e12e3c29a755d64096c8bd0220f
  Author: Valeriy Savchenko <vsavchenko at nitrogen.local>
  Date:   2020-05-28 (Thu, 28 May 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    M clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
    A clang/test/Analysis/PR35418.cpp
    M clang/test/Analysis/constant-folding.c
    M clang/test/Analysis/hangs.c
    A clang/test/Analysis/uninit-bug-first-iteration-init.c

  Log Message:
  -----------
  [analyzer] Introduce reasoning about symbolic remainder operator

Summary:
New logic tries to narrow possible result values of the remainder operation
based on its operands and their ranges.  It also tries to be conservative
with negative operands because according to the standard the sign of
the result is implementation-defined.

rdar://problem/44978988

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


Compare: https://github.com/llvm/llvm-project/compare/f5192d7fb756...73c120a9895a


More information about the All-commits mailing list