[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
Loading
Please register or sign in to comment