================
@@ -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:
> I would actually name it DeclParamIdx.
If that is the correct choice – thanks for correcting me. I just guessed that
`ASTIdx` looks like `ASTArgIdx` and didn't verify in the source what kind of
index is it in fact :sweat_smile:
Please also drop a comment like "getAstIndex() returns the index of the
parameter in the function declaration." next to the statement `unsigend
DeclParamIdx = Idx.getASTIndex();` to save the reader the need to jump to its
definition.
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