[all-commits] [llvm/llvm-project] 977880: [ObjC] Insert method parameters in scope as they a...
apple-fcloutier via All-commits
all-commits at lists.llvm.org
Wed Oct 30 20:34:59 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 97788089988a2ace63d717cadbcfe3443f380f9c
https://github.com/llvm/llvm-project/commit/97788089988a2ace63d717cadbcfe3443f380f9c
Author: apple-fcloutier <75502309+apple-fcloutier at users.noreply.github.com>
Date: 2024-10-30 (Wed, 30 Oct 2024)
Changed paths:
M clang/include/clang/Sema/SemaObjC.h
M clang/lib/Parse/ParseObjc.cpp
M clang/lib/Sema/SemaDeclObjC.cpp
Log Message:
-----------
[ObjC] Insert method parameters in scope as they are parsed (#113745)
Before this change, ParseObjc would call the closing
`MaybeParseAttributes` before it had created Objective-C `ParmVarDecl`
objects (and associated name lookup entries), meaning that you could not
reference Objective-C method parameters in
`__attribute__((diagnose_if))`. This change moves the creation of the
`ParmVarDecl` objects ahead of calling `Sema::ActOnMethodDeclaration` so
that `MaybeParseAttributes` can find them. This is already how it works
for C parameters hanging off of the selector.
This change alone is insufficient to enable `diagnose_if` for
Objective-C methods and effectively is NFC. There will be a follow-up PR
for diagnose_if. This change is still useful for any other work that may
need attributes to reference Objective-C parameters.
rdar://138596211
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list