Skip to content

[5.1][ParseableInterface][sourcekitd] Cherry-pick SourceKit parseable interface fixes #23106

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

Conversation

nathawes
Copy link
Contributor

@nathawes nathawes commented Mar 5, 2019

Cherry-pick of #22514 and #22550 for swift-5.1-branch

Nathan Hawes added 2 commits March 5, 2019 11:45
… file has errors.

We were checking the parent invocation's DiagnosticEnginer rather than the
subinstance's to determine if there were any errors building the module, which
meant we would fail to load the module if there were errors prior to the import
statement in the importing file.

This also meant code completion would fail to load the module, because it always
emits a bogus error in order to mark the AST as erroneous so that different
parts of the compiler (e.g. the verifier) have less strict assumptions.

rdar://problem/43906499
…langImporter option on the sub invocation if it's set on the parent

In addition to capturing more detailed preprocessor info, the
DetailedPreprocessorRecord option sets the clang module format to 'raw'
rather than the default 'object'. Sourcekitd doesn't link the code
generation libs, which it looks like the default 'object' format requires,
so it sets this option to true. The subinvocation generated when loading a
module from a .swiftinterface file still used the default prior to this
change though, so it would end up crashing sourcekitd.

This change sets the DetailedProccessorRecord option if the DetailedRecord
option is set on the preprocessor options of parent context's clang module
loader. This fixes interface generation crashing for modules that only have
a .swiftinterface file.

rdar://problem/43906499
@nathawes
Copy link
Contributor Author

nathawes commented Mar 5, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2019

Build failed
Swift Test Linux Platform
Git Sha - 58a8c9a

@nathawes
Copy link
Contributor Author

nathawes commented Mar 5, 2019

@swift-ci test linux

@nathawes nathawes marked this pull request as ready for review March 6, 2019 00:54
@nathawes nathawes merged commit 84d0a6f into swiftlang:swift-5.1-branch Mar 6, 2019
@nathawes nathawes deleted the cherry-pick-sourcekit-parseable-interface-fixes branch March 6, 2019 00:55
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