Skip to content

[CMake] Sema depends on Serialization these days. #10968

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
Jul 14, 2017

Conversation

jrose-apple
Copy link
Contributor

Specifically, it uses SerializedASTFile::getLanguageVersionBuiltWith to improve diagnostics. Not having this has led to failures on Linux, where linking order matters.

Specifically, it uses SerializedASTFile::getLanguageVersionBuiltWith
to improve diagnostics. Not having this has led to failures on Linux,
where linking order matters.
@jrose-apple jrose-apple requested a review from jckarter July 14, 2017 17:09
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit 970f020 into swiftlang:master Jul 14, 2017
@jrose-apple jrose-apple deleted the overly-tight-coupling branch July 14, 2017 17:42
@jrose-apple
Copy link
Contributor Author

Merging anyway to unblock my other commit, but I still need someone to sign off on it for the 4.0 branch. Joe, I tagged you just because IIRC you added the use.

@jckarter
Copy link
Contributor

Is there a better refactoring possible that loosens the coupling? Maybe instead of what we have today:

          auto *superFile = Super->getModuleScopeContext();
          if (auto *serialized = dyn_cast<SerializedASTFile>(superFile)) {
            if (serialized->getLanguageVersionBuiltWith() !=
                TC.getLangOpts().EffectiveLanguageVersion) {

We could add Optional<Version> getLanguageVersionBuiltWith() as an API on DeclContext, so you don't need to cast to a specific serialization type?

@jrose-apple
Copy link
Contributor Author

Yeah, looks like this isn't good enough anyway because we have a separate, unrelated circular dependency: Sema -> Parse -> SIL -> Sema. I think that's what's messing it up.

I'd move the API to FileUnit instead of SerializedASTFile if we were going to move it anywhere.

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