Skip to content

[Frontend] Move some stats + outputs to end of pipeline #32403

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 8 commits into from
Jun 18, 2020

Conversation

hamishknight
Copy link
Contributor

Move some stat collection and supplementary output logic to performEndOfPipelineActions to better fit the model of an inverted pipeline.

@hamishknight
Copy link
Contributor Author

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
@hamishknight hamishknight requested a review from CodaFi June 16, 2020 16:01
@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
@hamishknight
Copy link
Contributor Author

@swift-ci please clean test macOS

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

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

Having to tail-call this function manually makes me a bit nervous, but this looks great.

@hamishknight
Copy link
Contributor Author

@CodaFi Hmm, how about we factor out a performCompilePipeline function and have performCompile call both it and performEndOfPipelineActions?

@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jun 17, 2020
This better fits the model of an inverted pipeline
and ensures we capture all the work performed.
Move both the loaded module trace output and
"additional whole module outputs" to the end of
the pipeline, ensuring to preserve the behaviour
where we skip them if we encountered an error.
The use of `SWIFT_DEFER` previously meant that we
may return `false` from `performCompile` even if
an error was produced from
`performEndOfPipelineActions`.

To remedy this, introduce a lambda that both calls
`performEndOfPipelineActions`, and checks to see
if there was an error. Then, enforce that all exit
paths call this lambda.
Previously we may have silently bailed if a private
module interface path was specified, but the
frontend action didn't support it. Instead, make
sure we enforce the same restrictions that we
enforce for public module interfaces.
@hamishknight
Copy link
Contributor Author

swiftlang/llvm-project#1357

@swift-ci please test

@hamishknight
Copy link
Contributor Author

Merging for now, will work on cleaning up the interface in a follow up.

@hamishknight hamishknight merged commit 61a9a0d into swiftlang:master Jun 18, 2020
@hamishknight hamishknight deleted the over-and-out branch June 18, 2020 19:52
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