Skip to content

Sema: Only run extension binding once #31605

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
May 7, 2020

Conversation

slavapestov
Copy link
Contributor

There's no need to walk all imports of all source files, and bind the
extensions defined therein. The only time that a non-main module
contains source files is when using -enable-source-import, and we
can just explicitly call bindExtensions() in the right place.

…line

As part of eliminating cascading dependencies, we need to make sure to
capture any dependencies discovered during SILGen and IRGen.

This is a little bit tricky because we exit early in various places in
the pipeline, so we want to do it after performCompileStepsPostSema()
returns, but we can't do it too late, because the ASTContext might
already have been deallocated.

So emit the dependencies manually before freeing the ASTContext if we
decide to do that, or just do it before returning from performCompile()
using a SWIFT_DEFER otherwise.

This should have no observable effect until we start recording dependencies
for lookups done on behalf of declarations in secondary files.
@slavapestov slavapestov requested a review from CodaFi May 6, 2020 23:03
@slavapestov
Copy link
Contributor Author

LLVM change: swiftlang/llvm-project#1183

There's no need to walk all imports of all source files, and bind the
extensions defined therein. The only time that a non-main module
contains source files is when using -enable-source-import, and we
can just explicitly call bindExtensions() in the right place.
Doing it here is unnecessary anyway, because we've already performed
extension binding by this point.
@slavapestov slavapestov force-pushed the only-bind-extensions-once branch from 2e2c0e5 to 4c797cc Compare May 6, 2020 23:22
@slavapestov
Copy link
Contributor Author

swiftlang/llvm-project#1183
@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

swiftlang/llvm-project#1183
@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

swiftlang/llvm-project#1183
@swift-ci Please smoke test macOS

1 similar comment
@slavapestov
Copy link
Contributor Author

swiftlang/llvm-project#1183
@swift-ci Please smoke test macOS

@slavapestov slavapestov merged commit 9c8be74 into swiftlang:master May 7, 2020
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.

1 participant