[all-commits] [llvm/llvm-project] c6b848: [analyzer] StdLibraryFunctionsChecker refactor w/ ...
Gabor Marton via All-commits
all-commits at lists.llvm.org
Tue Mar 17 05:25:45 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: c6b8484e855bffb0a7da487cd715cef774a46fb1
https://github.com/llvm/llvm-project/commit/c6b8484e855bffb0a7da487cd715cef774a46fb1
Author: Gabor Marton <gabor.marton at ericsson.com>
Date: 2020-03-17 (Tue, 17 Mar 2020)
Changed paths:
M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
Log Message:
-----------
[analyzer] StdLibraryFunctionsChecker refactor w/ inheritance
Summary:
Currently, ValueRange is very hard to extend with new kind of constraints.
For instance, it forcibly encapsulates relations between arguments and the
return value (ComparesToArgument) besides handling the regular value
ranges (OutOfRange, WithinRange).
ValueRange in this form is not suitable to add new constraints on
arguments like "not-null".
This refactor introduces a new base class ValueConstraint with an
abstract apply function. Descendants must override this. There are 2
descendants: RangeConstraint and ComparisonConstraint. In the following
patches I am planning to add the NotNullConstraint, and additional
virtual functions like `negate()` and `warning()`.
Reviewers: NoQ, Szelethus, balazske, gamesh411, baloghadamsoftware, steakhal
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74973
More information about the All-commits
mailing list