Skip to content

[ASTGen] Fix expanded macro buffer parsing and AST generation #79513

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 1 commit into from
Feb 24, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 20, 2025

Parse macro expanded buffers into the dedicated syntax.

Also rename BridgedGeneratedSourceFileKindAttribute to BridgedGeneratedSourceFileKindAttributeFromClang because C++ decl (i.e. GeneratedSourceInfo::Kind::AttributeFromClang) was renamed a while ago.

@rintaro
Copy link
Member Author

rintaro commented Feb 20, 2025

swiftlang/swift-syntax#2968
@swift-ci Please smoke test

@rintaro rintaro force-pushed the astgen-macro-expanded-syntax branch 2 times, most recently from 16c9650 to c302e79 Compare February 21, 2025 05:38
@rintaro
Copy link
Member Author

rintaro commented Feb 21, 2025

swiftlang/swift-syntax#2968
@swift-ci Please smoke test

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Feb 21, 2025

swiftlang/swift-syntax#2968
@swift-ci Please smoke test

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Nice

@@ -1511,6 +1511,12 @@ enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedOperatorFixity {
BridgedOperatorFixityPostfix,
};

SWIFT_NAME("BridgedMissingDecl.createParsed(_:declContext:loc:)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling this createParsed doesn't feel right since the resulting decl is implicit, maybe just create, or createImplicit?

Parse expanded buffer into dedicated syntax.

Also rename `BridgedGeneratedSourceFileKindAttribute` to
`BridgedGeneratedSourceFileKindAttributeFromClang` because C++ decl
(i.e. `GeneratedSourceInfo::Kind::AttributeFromClang`) was renamed a
while ago.
@rintaro rintaro force-pushed the astgen-macro-expanded-syntax branch from c302e79 to aae50a8 Compare February 21, 2025 18:04
@rintaro
Copy link
Member Author

rintaro commented Feb 21, 2025

swiftlang/swift-syntax#2968
@swift-ci Please smoke test

@rintaro rintaro merged commit 38bafb3 into swiftlang:main Feb 24, 2025
3 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.

2 participants