Skip to content

[BoundsSafety] Parse external bounds attributes in ObjC methods #10068

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
merged 2 commits into from
Mar 28, 2025

Conversation

hnrklssn
Copy link

This parses counted_by et. al. for parameters and return types in Objective-C method signatures. No semantic checking is done to ensure that protocol, interface and implementation are aligned.

rdar://145190177

This parses counted_by et. al. for parameters and return types in
Objective-C method signatures. No semantic checking is done to ensure
that protocol, interface and implementation are aligned.

rdar://145190177
@hnrklssn
Copy link
Author

@swift-ci please smoke test

@hnrklssn
Copy link
Author

@swift-ci please test llvm

@hnrklssn
Copy link
Author

@swift-ci please smoke test

1 similar comment
@hnrklssn
Copy link
Author

hnrklssn commented Mar 6, 2025

@swift-ci please smoke test

// CHECK-NEXT: | |-ParmVarDecl {{.*}} len 'int'
// CHECK-NOT: IsDeref
// CHECK-NEXT: | | `-DependerDeclsAttr
// CHECK-NEXT: | `-ParmVarDecl {{.*}} p 'int *{{(__single)?}} __counted_by(len)':'int *{{(__single)?}}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't make thin pointers __single in attribute-only modes, so the expected output should be different between the two modes.

By separating the check lines containing implicit __single, we
explicitly check that attribute-only mode does not contain any implicit
__single attributes, while -fbounds-safety does.
@hnrklssn
Copy link
Author

@swift-ci please smoke test

@hnrklssn
Copy link
Author

@swift-ci please test llvm

Copy link

@rapidsna rapidsna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hnrklssn
Copy link
Author

@swift-ci please test linux

@hnrklssn
Copy link
Author

@swift-ci please test macos

@hnrklssn hnrklssn merged commit 6f817b2 into swiftlang:stable/20240723 Mar 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants