[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 17 02:08:46 PDT 2025


================
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply(
   return State->assume(L, CannotBeNull);
 }
 
-void StdLibraryFunctionsChecker::NotNullConstraint::describe(
+void StdLibraryFunctionsChecker::NullnessConstraint::describe(
     DescriptionKind DK, const CallEvent &Call, ProgramStateRef State,
     const Summary &Summary, llvm::raw_ostream &Out) const {
   assert(CannotBeNull &&
----------------
balazske wrote:

Did you check the comments of `describe` and `describeArgumentValue` (at class `ValueConstraint`)? If these are not exact they could be improved. I think that `describe` is used at reporting failed preconditions of functions when only non-null is the "usual" case, and `describeArgumentValue` is used when an execution path is displayed. Probably the assert is there to have a "summary case" description instead to explain the situation better.  (But I should check it in more detail.)

https://github.com/llvm/llvm-project/pull/131374


More information about the cfe-commits mailing list