[all-commits] [llvm/llvm-project] e37726: [analyzer] Implemented RangeSet::Factory::castTo f...

Denys Petrov via All-commits all-commits at lists.llvm.org
Tue Apr 19 12:34:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e37726beb22a8e3865e1f6fcdbb5cd4262786903
      https://github.com/llvm/llvm-project/commit/e37726beb22a8e3865e1f6fcdbb5cd4262786903
  Author: Denys Petrov <dpetrov at accesssoftek.com>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    M clang/unittests/StaticAnalyzer/RangeSetTest.cpp

  Log Message:
  -----------
  [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

Summary: 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]

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




More information about the All-commits mailing list