Skip to content

[🦩] Add ASTGen. #60943

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

Closed
wants to merge 11 commits into from
Closed

[🦩] Add ASTGen. #60943

wants to merge 11 commits into from

Conversation

zoecarver
Copy link
Contributor

@zoecarver
Copy link
Contributor Author

Thanks @CodaFi for the initial code that this was built off of.

@zoecarver zoecarver force-pushed the astgen branch 4 times, most recently from 98aa144 to ca6d481 Compare September 7, 2022 06:17
@zoecarver zoecarver marked this pull request as ready for review September 7, 2022 06:17

void *BridgedSourceLoc_advanced(void *loc, long len) {
SourceLoc l = ((SourceLoc *)&loc)->getAdvancedLoc(len);
return &l; // TODO: what?
Copy link
Member

Choose a reason for hiding this comment

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

SourceLoc is just a pointer in a trench coat; you can return its opaque value.

}

BridgedIdentifier
SwiftASTContext_getIdentifier(void *ctx, const char *_Nullable str, long len) {
Copy link
Member

Choose a reason for hiding this comment

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

This whole file is mind-numbingly dull to write, but at least it's straightforward!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I wonder if we could write a python script that gets us 90% of the way there.

@@ -49,9 +49,15 @@ add_swift_host_tool(swift-frontend
)
target_link_libraries(swift-frontend
PUBLIC
ASTGen
swiftCore # TODO: how do we fix this?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DougGregor any idea how to get the link paths for this?

@zoecarver
Copy link
Contributor Author

I updated this to use your changes from #60888. Much cleaner :)

@zoecarver
Copy link
Contributor Author

@swift-ci please test.

@zoecarver
Copy link
Contributor Author

@swift-ci please test.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.


void NominalTypeDecl_setMembers(void *decl, BridgedArrayRef members);

struct DeclContextAndDecl {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This type really sucks :(

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

@zoecarver zoecarver changed the title [🦩] Add Swift-side infrastructure for ASTGen. [🦩] Add ASTGen. Sep 14, 2022
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

@zoecarver
Copy link
Contributor Author

@DougGregor pretty sure that resolved all the linker errors. I want to see the CI pass once, then I'll add the cmake option.

@zoecarver
Copy link
Contributor Author

Closing in favor of #61426 (review)

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