================
@@ -692,6 +692,14 @@ void NullabilityChecker::checkPreStmt(const ReturnStmt *S,
   NullConstraint Nullness = getNullConstraint(*RetSVal, State);
 
   Nullability RequiredNullability = getNullabilityAnnotation(RequiredRetType);
+  if (const auto *FunDecl = C.getLocationContext()->getDecl();
----------------
necto wrote:

`getNullabilityAnnotation` is concerned only with the type. It is used both for 
return types and function parameters by multiple checkers.
Handling the function annotation there would mean I have to pass the function 
declaration (which might not be available in the client of the API), which is 
only relevant in one case (and maybe another couple in TrustNonnullChecker). 
That means I would need to complicate the function definition and potentially 
increase the PR footprint by touching all call sites.

https://github.com/llvm/llvm-project/pull/106048
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to