Skip to content

[NFC] Create PackageUnit class, and Package entries to DeclContext / ASTHierarchy #64034

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 3 commits into from
Mar 3, 2023

Conversation

elsh
Copy link
Contributor

@elsh elsh commented Mar 2, 2023

Previously enum AccessLimitKind was added to distinguish access scopes b/t package and public while keeping DeclContext null but it proved to be too limiting. This PR creates package specific entries for DeclContext and ASTHierarchy. It create a new class PackageUnit that can be set as the parent DeclContext of ModuleDecl. This PR contains addition of such entries but not the use of them; the actual use of them will be in the upcoming PRs.
Resolves rdar://106155600

@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci test

@elsh elsh requested review from xymus, tshortli, beccadax and artemcm March 2, 2023 19:06
@elsh elsh changed the title Create PackageUnit class mapped to package scope / add corresponding entries to DeclContext and ASTHierarchy Create PackageUnit class, and Package entries to DeclContext / ASTHierarchy Mar 2, 2023
@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci test

@elsh elsh changed the title Create PackageUnit class, and Package entries to DeclContext / ASTHierarchy [NFC] Create PackageUnit class, and Package entries to DeclContext / ASTHierarchy Mar 2, 2023
@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci test

…THierarchy

Previously enum AccessLimitKind was
added to distinguish access scopes b/t package and public while keeping
DeclContext null but it proved to be too limiting. This PR creates package specific entries for DeclContext and
ASTHierarchy. It create a new class PackageUnit that can be set as the parent DeclContext of ModuleDecl. This PR
contains addition of such entries but not the use of them; the actual use of them will be in the upcoming PRs.

Resolves rdar://106155600
@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci test

@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci test

@@ -1830,7 +1831,6 @@ static bool shouldSerializeMember(Decl *D) {
if (D->getASTContext().LangOpts.AllowModuleWithCompilerErrors)
return false;
llvm_unreachable("decl should never be a member");

case DeclKind::Missing:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: This chunk and the next one doesn't fit with the overall spacing style of this code. If you get back to this code or have to update this PR it would be nice to make it uniform.

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

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

This looks good, I think that structure will make overall improvements to packages easier in the future too.

@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci smoke test

@elsh
Copy link
Contributor Author

elsh commented Mar 2, 2023

@swift-ci smoke test

@elsh elsh merged commit 2abf14a into main Mar 3, 2023
@elsh elsh deleted the es-declctx branch March 3, 2023 02:57
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