[all-commits] [llvm/llvm-project] 160798: [analyzer] Handle SymbolCast in SValBuilder

Gabor Marton via All-commits all-commits at lists.llvm.org
Tue May 31 23:42:25 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 160798ab9be87a9be323966c5f5816a5b7ca818f
      https://github.com/llvm/llvm-project/commit/160798ab9be87a9be323966c5f5816a5b7ca818f
  Author: Gabor Marton <gabor.marton at ericsson.com>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
    A clang/test/Analysis/svalbuilder-casts.cpp

  Log Message:
  -----------
  [analyzer] Handle SymbolCast in SValBuilder

Make the SimpleSValBuilder to be able to look up and use a constraint
for an operand of a SymbolCast, when the operand is constrained to a
const value.
This part of the SValBuilder is responsible for constant folding. We
need this constant folding, so the engine can work with less symbols,
this way it can be more efficient. Whenever a symbol is constrained with
a constant then we substitute the symbol with the corresponding integer.
If a symbol is constrained with a range, then the symbol is kept and we
fall-back to use the range based constraint manager, which is not that
efficient. This patch is the natural extension of the existing constant
folding machinery with the support of SymbolCast symbols.

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




More information about the All-commits mailing list