[PATCH] D131006: [analyzer] Use DisequalityMap while inferring constraints

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 11:45:18 PDT 2022


ASDenysPetrov created this revision.
ASDenysPetrov added reviewers: martong, steakhal, NoQ.
ASDenysPetrov added a project: clang.
Herald added subscribers: manas, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: All.
ASDenysPetrov requested review of this revision.
Herald added a subscriber: cfe-commits.

Infer range using associated unequal symbols from DisequalityMap.
Example:

  if(x == 42)
    if(x != y)
      y; // [-2147483648, 41]U[43, 2147483647]

NOTE: Currently, this revision causes test failure due to assertion in related to `IteratorModeling.cpp` in `relateSymbols` on line
`assert(isa<SymIntExpr>(CompSym) && "Symbol comparison must be a `SymIntExpr`");`. It needs to be fixed in some way before loading. The revision is exposed to show the motivation for D130372 <https://reviews.llvm.org/D130372>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131006

Files:
  clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
  clang/test/Analysis/range-inferring-from-disequality-map.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131006.449362.patch
Type: text/x-patch
Size: 4587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220802/be0721d6/attachment.bin>


More information about the cfe-commits mailing list