[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 25 09:03:15 PDT 2021


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

Handle casts for ranges working similarly to APSIntType::apply function but for the whole range set. Support promotions, truncations and conversions.
Example:
Promotion: `char [0, 42] -> short [0, 42] -> int [0, 42] -> llong [0, 42]`
Truncation: `llong [4295033088, 4295033130] -> int [65792, 65834] -> short [256, 298] -> char [0, 42]`
Conversion: `char [-42, 42] -> uint [0, 42]U[4294967254, 4294967295] -> short[-42, 42]`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103094

Files:
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
  clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
  clang/unittests/StaticAnalyzer/RangeSetTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103094.347699.patch
Type: text/x-patch
Size: 27635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210525/833536da/attachment-0001.bin>


More information about the cfe-commits mailing list