-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[sourcekit] Use the driver to parse command line arguments #14366
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
@swift-ci please test |
Build failed |
This will reduce test churn when we start using the driver to parse arguments. We don't really care what the module name is for these fallback cases.
32d1d42
to
f01d79f
Compare
@swift-ci please test |
Build failed |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my end.
@swift-ci please test macOS platform |
Build failed |
f01d79f
to
a73b35f
Compare
Updated tests: tests that use the built swift modules also need to pass a matching -target. Adding the target option exposed some other tests that had mac-specific output, so disabled those on other platforms. This is a symptom of the fact that the majority of our sourcekitd tests are really only running for the host platform, since they are not setting a target triple explicitly. |
@swift-ci please test |
Build failed |
Build failed |
These tests were relying on sourcekitd parsing as frontend instead of using the driver. Update them now to avoid churn when we fix command line argument parsing in sourcekit. The changes from clang-importer-sdk to clang-importer-sdk-nosource -I %t are because clang-importer-sdk implies using -enable-source-import. Rather than hack them up to use -Xfrontend, it is cleaner to just stop using source import at all for these tests. Incidentally, this improved fidelity in a few places. When using the generated swift modules we also need to pass a target triple to sourcekit, which exposed some tests that had mac-specific data. This is a systemic issue for sourcekit tests, but for now just make those few specific tests that we had problems with run only on mac.
a73b35f
to
8e949db
Compare
@swift-ci please test |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
Stop parsing frontend arguments directly and use the driver instead. The most intersting part of this change is that it forces us to consider whether our compiler invocation will have inputs or not. We have several kinds of requests that need to create a compiler instance, but not parse any inputs (interface-generation, doc-info, and indexing when operating on a module instead of source files). Incidentally, add an error when trying to do doc-info on multiple source files. This was already very broken (assertion failures and bogus source locations), so add an error for it. rdar://problem/17897287
8e949db
to
72bde68
Compare
@swift-ci please test |
Build failed |
Build failed |
Stop parsing frontend arguments directly and use the driver instead. The most intersting part of this change is that it forces us to consider whether our compiler invocation will have inputs or not. We have several kinds of requests that need to create a compiler instance, but not parse any inputs (interface-generation, doc-info, and indexing when operating on a module instead of source files).
rdar://17897287