Skip to content

Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST() #19024

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
Aug 30, 2018

Conversation

adrian-prantl
Copy link
Contributor

LLDB needs the -swift-version because the -D__swift__ macro affects
how Clang modules are built. This currently has the really odd effect
that when debugging a Swift program that is not using the very latest
Swift version, the first "po" takes several seconds, because the
module cache needs to be rebuilt.

rdar://problem/40241256

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

…omSerializedAST()

LLDB needs the -swift-version because the -D__swift__ macro affects
how Clang modules are built. This currently has the really odd effect
that when debugging a Swift program that is not using the very latest
Swift version, the first "po" takes several seconds, because the
module cache needs to be rebuilt.

rdar://problem/40241256
@adrian-prantl
Copy link
Contributor Author

@benlangmuir: Would this negatively affect SourceKit? I could imagine that SourceKit has a similar performance problem. If this is a problem we could hide this behavior behind a flag.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@jrose-apple
Copy link
Contributor

jrose-apple commented Aug 28, 2018

I guess this is the right default behavior, and then the expression context will override this with "newest version"?

AFAIK SourceKit doesn't use CompilerInvocation::loadFromSerializedAST for anything, though perhaps they should.

@adrian-prantl
Copy link
Contributor Author

It's exposed in swift-ide-test, but that may have been us (the LLDB folks).

@adrian-prantl
Copy link
Contributor Author

adrian-prantl commented Aug 28, 2018

Yeah: LLDB could pick something like max(all compatibility versions from all dylibs) for the expression context and the exact match for the per-module context.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 97cbd3b

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 97cbd3b

@benlangmuir
Copy link
Contributor

I have no concerns about this (as Jordan said, we don't use this API in sourcekitd), but I don't fully understand its consequences in lldb, so removing myself as reviewer.

@benlangmuir benlangmuir removed their request for review August 29, 2018 14:29
@adrian-prantl
Copy link
Contributor Author

@swift-ci smoke test and merge

1 similar comment
@adrian-prantl
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 6e16e29 into swiftlang:master Aug 30, 2018
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.

4 participants