Skip to content

Break Driver's dependency on Frontend #19012

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 2 commits into from
Aug 28, 2018

Conversation

jrose-apple
Copy link
Contributor

The main tricky part here was driver::createCompilerInvocation, but it turned out that the part of that that actually used Frontend wasn't the important part. I changed it into a function with a callback, driver::getSingleFrontendInvocationFromDriverArguments, and it actually resulted in some (tiny) improvements even with the minor additional duplication at call sites.

There's not such a big win from this or anything, but it'd been bothering me for a while. No user-visible functionality change.

- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
But not even that much uglier; at all three call sites this will save
an allocation, and for the most important one (SourceKit) we can now
avoid creating a temporary CompilerInvocation just to copy into a
longer-lived one.

With this change, Driver no longer depends on Frontend, which means...
well, slightly faster builds of the compiler itself, but not much
else.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please clean test

Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jrose-apple jrose-apple merged commit 6a5619e into swiftlang:master Aug 28, 2018
@jrose-apple jrose-apple deleted the driver-off-into-the-sunset branch August 28, 2018 16:34
@@ -1,4 +1,4 @@
//===--- OutputFileMap.cpp - Driver output file map -----------------------===//
//===--- OutputFileMap.h - Map of inputs to multiple outputs --------------===//
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I just merged before spotting the typo.

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