forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 342
Reland "[APINotes] Add support for bounds safety annotations" #9942
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
hnrklssn
merged 3 commits into
stable/20240723
from
revert-9908-revert-9822-bounds-safety-apinotes
Feb 6, 2025
Merged
Reland "[APINotes] Add support for bounds safety annotations" #9942
hnrklssn
merged 3 commits into
stable/20240723
from
revert-9908-revert-9822-bounds-safety-apinotes
Feb 6, 2025
Conversation
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
This reverts commit 7cbd1e7.
@swift-ci please test llvm |
rdar://143701027
@swift-ci please test llvm |
5 similar comments
@swift-ci please test llvm |
@swift-ci please test llvm |
@swift-ci please test llvm |
@swift-ci please test llvm |
@swift-ci please test llvm |
These test cases use clang modules. TypeCoupledDeclRefInfo serialization/deserialization is currently broken on Linux, so disable these tests until it's been resolved.
72de84a
to
9f4dbbc
Compare
@swift-ci please test llvm |
@swift-ci please test |
delcypher
pushed a commit
to delcypher/apple-llvm-project
that referenced
this pull request
May 22, 2025
This cherry-picks ``` commit e5e04cd Author: Henrik G. Olsson <[email protected]> Date: Mon Feb 3 10:25:30 2025 -0800 Revert "Revert "[APINotes] Add support for bounds safety annotations"" This reverts commit 7cbd1e7. ``` from the `swift/release/6.2` branch (landed in swiftlang#9942). Conflicts: clang/include/clang/Parse/Parser.h clang/include/clang/Sema/Sema.h clang/lib/APINotes/APINotesFormat.h Below is the original commit message. rdar://151820159 --- [APINotes] Add support for bounds safety annotations This adds support for annotating function parameters with __counted_by, __sized_by, __counted_by_or_null, __sized_by_or_null, and __ended_by, using API notes. The main content of handlePtrCountedByEndedByAttr is extracted to applyPtrCountedByEndedByAttr and decoupled from ParsedAttr. The helper function ParseBoundsAttributeArgFromString is added to make it possible to parse count expressions from SemaAPINotes. The current implementation of __terminated_by/__null_terminated makes it harder to extract from the iterative type processing, but since it doesn't require any extra context to parse the attribute, it can be applied using the normal Type override instead. rdar://139830881
delcypher
pushed a commit
that referenced
this pull request
May 22, 2025
This cherry-picks ``` commit e5e04cd Author: Henrik G. Olsson <[email protected]> Date: Mon Feb 3 10:25:30 2025 -0800 Revert "Revert "[APINotes] Add support for bounds safety annotations"" This reverts commit 7cbd1e7. ``` from the `swift/release/6.2` branch (landed in #9942). Conflicts: clang/include/clang/Parse/Parser.h clang/include/clang/Sema/Sema.h clang/lib/APINotes/APINotesFormat.h Below is the original commit message. rdar://151820159 --- [APINotes] Add support for bounds safety annotations This adds support for annotating function parameters with __counted_by, __sized_by, __counted_by_or_null, __sized_by_or_null, and __ended_by, using API notes. The main content of handlePtrCountedByEndedByAttr is extracted to applyPtrCountedByEndedByAttr and decoupled from ParsedAttr. The helper function ParseBoundsAttributeArgFromString is added to make it possible to parse count expressions from SemaAPINotes. The current implementation of __terminated_by/__null_terminated makes it harder to extract from the iterative type processing, but since it doesn't require any extra context to parse the attribute, it can be applied using the normal Type override instead. rdar://139830881
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reverts #9908