================
@@ -63,23 +80,27 @@ void setBitsAccordingToFunctionAttributes(const CallType 
&Call,
       // 'nonnull' attribute's parameters are 1-based and should be adjusted to
       // match actual AST parameter/argument indices.
       unsigned IdxAST = Idx.getASTIndex();
-      if (IdxAST >= AttrNonNull.size())
+      if (IdxAST < Offset)
+        continue;
+      const unsigned IdxArg = IdxAST - Offset;
----------------
NagyDonat wrote:

Why do you implement this as a subtraction instead of a calling a "convert from 
this indexing kind to that indexing kind" method of the `CallEvent`?

It's a bit surprising that this checker knows the implementation details that 
the conversion can be always described by subtracting an offset (and doing some 
_if_ checks), while other code calls a conversion method which may do anything.

https://github.com/llvm/llvm-project/pull/221977
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to