-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Swiftify] Copy doc comment from clang node #81584
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6ccdbdb
[Swiftify] Copy doc comment from clang node
hnrklssn ad8f2c8
add comment
hnrklssn f0a7cba
add sourcekit test
hnrklssn f9507b9
add comment about being auto-generated wrapper
hnrklssn a907481
add REQUIRES SafeInteropWrappers to test
hnrklssn 7e78a6f
check symbol graph
hnrklssn 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
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 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,30 @@ | ||
#pragma once | ||
|
||
#define __counted_by(x) __attribute__((__counted_by__(x))) | ||
|
||
void begin(); | ||
|
||
// line comment | ||
void lineComment(int len, int * __counted_by(len) p); | ||
|
||
/// line doc comment | ||
/// | ||
/// Here's a more complete description. | ||
/// | ||
/// @param len the buffer length | ||
/// @param p the buffer | ||
void lineDocComment(int len, int * __counted_by(len) p); | ||
|
||
/* | ||
block comment | ||
*/ | ||
void blockComment(int len, int * __counted_by(len) p); | ||
|
||
/** | ||
* block doc comment | ||
* | ||
* NB: it's very important to pass the correct length to this function | ||
* @param len don't mess this one up | ||
* @param p some integers to play with | ||
*/ | ||
void blockDocComment(int len, int * __counted_by(len) p); |
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 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,52 @@ | ||
// REQUIRES: swift_feature_SafeInteropWrappers | ||
|
||
// RUN: %target-swift-ide-test -print-module -module-to-print=CommentsClang -plugin-path %swift-plugin-dir -I %S/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --strict-whitespace --match-full-lines | ||
|
||
// Check that doc comments are carried over from clang to the safe macro expansion. | ||
|
||
// CHECK:func begin() | ||
// CHECK-NEXT:func lineComment(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) | ||
|
||
// CHECK-NEXT:/// line doc comment | ||
// CHECK-NEXT:/// | ||
// CHECK-NEXT:/// Here's a more complete description. | ||
// CHECK-NEXT:/// | ||
// CHECK-NEXT:/// @param len the buffer length | ||
// CHECK-NEXT:/// @param p the buffer | ||
// CHECK-NEXT:func lineDocComment(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) | ||
|
||
// CHECK-NEXT:func blockComment(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) | ||
|
||
// CHECK-NEXT:/** | ||
// CHECK-NEXT: * block doc comment | ||
// CHECK-NEXT: * | ||
// CHECK-NEXT: * NB: it's very important to pass the correct length to this function | ||
// CHECK-NEXT: * @param len don't mess this one up | ||
// CHECK-NEXT: * @param p some integers to play with | ||
// CHECK-NEXT: */ | ||
// CHECK-NEXT:func blockDocComment(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) | ||
|
||
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop | ||
// CHECK-NEXT:@_alwaysEmitIntoClient public func blockComment(_ p: UnsafeMutableBufferPointer<Int32>) | ||
|
||
// CHECK-NEXT:/** | ||
// CHECK-NEXT: * block doc comment | ||
// CHECK-NEXT: * | ||
// CHECK-NEXT: * NB: it's very important to pass the correct length to this function | ||
// CHECK-NEXT: * @param len don't mess this one up | ||
// CHECK-NEXT: * @param p some integers to play with | ||
// CHECK-NEXT: */ | ||
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop | ||
// CHECK-NEXT:@_alwaysEmitIntoClient public func blockDocComment(_ p: UnsafeMutableBufferPointer<Int32>) | ||
|
||
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop | ||
// CHECK-NEXT:@_alwaysEmitIntoClient public func lineComment(_ p: UnsafeMutableBufferPointer<Int32>) | ||
|
||
// CHECK-NEXT:/// line doc comment | ||
// CHECK-NEXT:/// | ||
// CHECK-NEXT:/// Here's a more complete description. | ||
// CHECK-NEXT:/// | ||
// CHECK-NEXT:/// @param len the buffer length | ||
// CHECK-NEXT:/// @param p the buffer | ||
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop | ||
// CHECK-NEXT:@_alwaysEmitIntoClient public func lineDocComment(_ p: UnsafeMutableBufferPointer<Int32>) |
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 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 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 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
We might want to add a comment here that references an issue (or radar) about the fact that
@param
and might need to be rewritten.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.
I think this is a minor enough potential future QoL improvement that it doesn't warrant polluting the code with discussion around it