-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang][DebugInfo] Don't mark explicit parameter of synthesized ObjC property accessors artificial #164998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Michael137
merged 2 commits into
llvm:main
from
Michael137:clang/property-artificial-param
Oct 27, 2025
Merged
[clang][DebugInfo] Don't mark explicit parameter of synthesized ObjC property accessors artificial #164998
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
clang/test/DebugInfo/ObjC/property-synthesized-accessors.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // Test that synthesized accessors get treated like regular method declarations/defeinitions. | ||
| // I.e.: | ||
| // 1. explicitly passed parameter are not marked artificial. | ||
| // 2. Each property accessor has a method declaration and definition. | ||
|
|
||
| // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -dwarf-version=5 -debug-info-kind=limited %s -o - | FileCheck %s --implicit-check-not "DIFlagArtificial" | ||
|
|
||
| @interface Foo | ||
| @property int p1; | ||
| @end | ||
|
|
||
| @implementation Foo | ||
| @end | ||
|
|
||
| int main(void) { | ||
| Foo *f; | ||
| f.p1 = 2; | ||
| return f.p1; | ||
| } | ||
|
|
||
| // CHECK: ![[P1_TYPE:[0-9]+]] = !DIBasicType(name: "int" | ||
| // CHECK: ![[GETTER_DECL:[0-9]+]] = !DISubprogram(name: "-[Foo p1]" | ||
| // CHECK-SAME: type: ![[GETTER_TYPE:[0-9]+]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped | ||
| // CHECK-SAME: spFlags: DISPFlagLocalToUnit) | ||
|
|
||
| // CHECK: ![[GETTER_TYPE]] = !DISubroutineType(types: ![[GETTER_PARAMS:[0-9]+]]) | ||
| // CHECK: ![[GETTER_PARAMS]] = !{![[P1_TYPE]], ![[ID_TYPE:[0-9]+]], ![[SEL_TYPE:[0-9]+]]} | ||
| // CHECK: ![[ID_TYPE]] = !DIDerivedType(tag: DW_TAG_pointer_type | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer) | ||
| // CHECK: ![[SEL_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL" | ||
| // CHECK-SAME: flags: DIFlagArtificial) | ||
|
|
||
| // CHECK: ![[SETTER_DECL:[0-9]+]] = !DISubprogram(name: "-[Foo setP1:]" | ||
| // CHECK-SAME: type: ![[SETTER_TYPE:[0-9]+]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped | ||
| // CHECK-SAME: spFlags: DISPFlagLocalToUnit) | ||
| // CHECK: ![[SETTER_TYPE]] = !DISubroutineType(types: ![[SETTER_PARAMS:[0-9]+]]) | ||
| // CHECK: ![[SETTER_PARAMS]] = !{null, ![[ID_TYPE]], ![[SEL_TYPE]], ![[P1_TYPE]]} | ||
|
|
||
| // CHECK: ![[GETTER_DEF:[0-9]+]] = distinct !DISubprogram(name: "-[Foo p1]" | ||
| // CHECK-SAME: type: ![[GETTER_TYPE]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped | ||
| // CHECK-SAME: spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | ||
| // CHECK-SAME: declaration: ![[GETTER_DECL]] | ||
|
|
||
| // CHECK: !DILocalVariable(name: "self", arg: 1, scope: ![[GETTER_DEF]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer) | ||
| // | ||
| // CHECK: !DILocalVariable(name: "_cmd", arg: 2, scope: ![[GETTER_DEF]], | ||
| // CHECK-SAME: flags: DIFlagArtificial) | ||
|
|
||
| // CHECK: ![[SETTER_DEF:[0-9]+]] = distinct !DISubprogram(name: "-[Foo setP1:]", | ||
| // CHECK-SAME: type: ![[SETTER_TYPE]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped | ||
| // CHECK-SAME: spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | ||
| // CHECK-SAME: declaration: ![[SETTER_DECL]] | ||
|
|
||
| // CHECK: !DILocalVariable(name: "self", arg: 1, scope: ![[SETTER_DEF]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer | ||
| // CHECK: !DILocalVariable(name: "_cmd", arg: 2, scope: ![[SETTER_DEF]] | ||
| // CHECK-SAME: flags: DIFlagArtificial | ||
| // CHECK: !DILocalVariable(name: "p1", arg: 3, scope: ![[SETTER_DEF]] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.