-
Notifications
You must be signed in to change notification settings - Fork 127
Replace #fileID, #filePath, #line, and #column with a single macro.
#304
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
grynspan
merged 4 commits into
main
from
jgrynspan/replace-source-location-arguments-with-one-macro
Jun 13, 2024
Merged
Replace #fileID, #filePath, #line, and #column with a single macro.
#304
grynspan
merged 4 commits into
main
from
jgrynspan/replace-source-location-arguments-with-one-macro
Jun 13, 2024
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
e39dc93 to
9c1aca1
Compare
Contributor
Author
|
@swift-ci please test |
#fileID, #filePath, #line, and #column with a single macro.#fileID, #filePath, #line, and #column with a single macro.
9c1aca1 to
b3c34c4
Compare
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test Windows |
b3c34c4 to
880a5ae
Compare
#fileID, #filePath, #line, and #column with a single macro.#fileID, #filePath, #line, and #column with a single macro.
880a5ae to
c2d1142
Compare
…macro. We have a bunch of functions that take separate, defaulted arguments for file ID, column, etc. We'd like to normalize these functions to always take a single `SourceLocation` instance, but until now there hasn't been a way to express such a thing as a default argument without capturing the wrong source location. This PR takes advantage of [SE-0422](https://github.com/apple/swift-evolution/blob/main/proposals/0422-caller-side-default-argument-macro-expression.md) to create a new `#currentSourceLocation` macro that does what we want here. (We can't use `#sourceLocation` because the language already reserves that macro name for an unrelated use.)
c2d1142 to
95fa0b5
Compare
Contributor
Author
|
@swift-ci please test |
Co-authored-by: Stuart Montgomery <[email protected]>
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test Linux |
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.
We have a bunch of functions that take separate, defaulted arguments for file ID, column, etc. We'd like to normalize these functions to always take a single
SourceLocationinstance, but until now there hasn't been a way to express such a thing as a default argument without capturing the wrong source location.This PR takes advantage of SE-0422 to create a new
#_sourceLocationmacro (name pending API review) that does what we want here. We can't use the obvious#sourceLocationbecause the language already reserves that macro name for an unrelated use.Resolves rdar://121883259.
Checklist: