Skip to content

Commit

Permalink
Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomat…
Browse files Browse the repository at this point in the history
…sakis

Take commandline arguments into account for incr. comp.

Implements the conservative strategy described in rust-lang/rust#33727.

From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples.

The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct.

One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data.

It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map.

Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
  • Loading branch information
bors authored Aug 15, 2016
2 parents bb18f29 + 7102f2b commit 6953d69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,7 @@ actual:\n\
// Add an extra flag pointing at the incremental directory.
let mut revision_props = self.props.clone();
revision_props.incremental_dir = Some(incremental_dir);
revision_props.compile_flags.push(String::from("-Zincremental-info"));

let revision_cx = TestCx {
config: self.config,
Expand Down

0 comments on commit 6953d69

Please sign in to comment.