Uh oh!
There was an error while loading. Please reload this page.
rustc: reorganize driver, replace compile_upto with multiple more-obvious functions. - #8077
Closed
graydon wants to merge 1 commit into
Closed
rustc: reorganize driver, replace compile_upto with multiple more-obvious functions.#8077graydon wants to merge 1 commit into
graydon wants to merge 1 commit into
Conversation
emberian
commented
Jul 27, 2013
Contributor
Yes, this is wonderful! Much much better. |
bors added a commit
that referenced
this pull request
Jul 27, 2013
The purpose here is to get rid of compile_upto, which pretty much always requires the user to read the source to figure out what it does. It's replaced by a sequence of obviously-named functions: - phase_1_parse_input(sess, cfg, input); - phase_2_configure_and_expand(sess, cfg, crate); - phase_3_run_analysis_passes(sess, expanded_crate); - phase_4_translate_to_llvm(sess, expanded_crate, &analysis, outputs); - phase_5_run_llvm_passes(sess, &trans, outputs); - phase_6_link_output(sess, &trans, outputs); Each of which takes what it takes and returns what it returns, with as little variation as possible in behaviour: no "pairs of options" and "pairs of control flags". You can tell if you missed a phase because you will be missing a `phase_N` call to some `N` between 1 and 6. It does mean that people invoking librustc from outside need to write more function calls. The benefit is that they can _figure out what they're doing_ much more easily, and stop at any point, rather than further overloading the tangled logic of `compile_upto`.
brson
commented
Jul 28, 2013
Contributor
Glad to see some long-needed front-end cleanup. |
huonw
commented
Jul 28, 2013
Contributor
This appears to cause a >500MB memory use regression. |
dotdash added a commit
to dotdash/rust
that referenced
this pull request
Jul 28, 2013
This fixes the recently introduced peak memory usage regression by freeing the intermediate results as soon as they're not required anymore instead of keeping them around for the whole compilation process. Refs rust-lang#8077
bors added a commit
that referenced
this pull request
Jul 28, 2013
This fixes the recently introduced peak memory usage regression by freeing the intermediate results as soon as they're not required anymore instead of keeping them around for the whole compilation process. Refs #8077
flip1995 pushed a commit
to flip1995/rust
that referenced
this pull request
Dec 6, 2021
…negatives, r=camsteffen
Fix some false negatives for [`single_char_pattern`]
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: Fix some false negatives for [`single_char_pattern`]
I noticed that clippy wasn't complaining about my usage of `split_once("x")` in a personal project so I updated the list of functions.
I had to update the test case for an unrelated issue because replace is now included in the list of functions to be linted.U007D pushed a commit
to U007D/rust-mos
that referenced
this pull request
Aug 21, 2026
8371: Don't use HirDisplayWrapper when displaying SourceCode r=matklad a=Veykril The issue was basically that when displaying for `DisplayTarget::SourceCode` some `hir_fmt` functions would create `HirDisplayWrapper`s which would then `fmt` these triggering the Display panic since `fmt::Display` can't fail the same way as `HirDisplay`. Simple fix is to just use `hir_fmt` directly. Should probably write that down somewhere in source, looking for a good spot to put that right now. Fixesrust-lang#8077, Fixesrust-lang#8370 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The purpose here is to get rid of compile_upto, which pretty much always requires the user to read the source to figure out what it does. It's replaced by a sequence of obviously-named functions:
Each of which takes what it takes and returns what it returns, with as little variation as possible in behaviour: no "pairs of options" and "pairs of control flags". You can tell if you missed a phase because you will be missing a
phase_Ncall to someNbetween 1 and 6.It does mean that people invoking librustc from outside need to write more function calls. The benefit is that they can figure out what they're doing much more easily, and stop at any point, rather than further overloading the tangled logic of
compile_upto.