Skip to content
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

Various improvements to the SVH #35079

Merged
merged 6 commits into from
Aug 10, 2016
Merged

Conversation

nikomatsakis
Copy link
Contributor

This fixes a few points for the SVH:

  • incorporate resolve results into the SVH;
  • don't include nested items.

r? @michaelwoerister

cc #32753 (not fully fixed I don't think)

@nikomatsakis
Copy link
Contributor Author

we may need to add a few more resolve cases, actually.

// except according to those terms.

// Check that the hash for `mod3::bar` changes when we change the
// `use` to something different.
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems to be a leftover from another test case.

@michaelwoerister
Copy link
Member

Looks good to me. I like that we are getting more and more of these test cases that make sure some fundamental things don't regress.

we may need to add a few more resolve cases, actually.

Care to elaborate on that?

@nikomatsakis
Copy link
Contributor Author

@michaelwoerister re-r? those last few commits -- I switched to use IdVisitor

@bors
Copy link
Contributor

bors commented Jul 29, 2016

☔ The latest upstream changes (presumably #34956) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -58,6 +58,7 @@ impl<'a, 'tcx> SvhCalculate for TyCtxt<'a, 'tcx, 'tcx> {
{
let mut visit = StrictVersionHashVisitor::new(&mut state, self);
krate.visit_all_items(&mut visit);
krate.visit_all_items(&mut IdVisitor::new(&mut visit));
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need to do this for the SVH since we are visiting all use declarations too in that case, right? Although, that would kind of rely on things being visited in lexical order...

@michaelwoerister
Copy link
Member

The new commits look good. However, the IdVisitor is on it's way out (see #35090). But with that refactoring landed it should be even easier, since then the visit_id method will just be part of the regular Visitor trait. We'll see which PR wins the race ;)

@nikomatsakis
Copy link
Contributor Author

We probably don't need to do this for the SVH since we are visiting all use declarations too in that case, right? Although, that would kind of rely on things being visited in lexical order...

Perhaps, though I've been wondering if can just strip use statements out of the HIR. They don't seem needed if resolution checking is taking place earlier.

@nikomatsakis
Copy link
Contributor Author

@michaelwoerister

We'll see which PR wins the race

Game on! ;)

Yes, I expect to rebase on #35090, though this PR has a lower number I guess.

@michaelwoerister
Copy link
Member

Perhaps, though I've been wondering if can just strip use statements out of the HIR.

We don't do it yet, but we plan to map them into debuginfo as DW_TAG_imported_declaration DIEs, so that's one case where we'd still need them.

@nikomatsakis
Copy link
Contributor Author

@michaelwoerister rebased atop your PR.

@bors r=mw

@bors
Copy link
Contributor

bors commented Jul 29, 2016

📌 Commit 660716b has been approved by mw

@nikomatsakis
Copy link
Contributor Author

@bors r-

Travis failure looks legit:

---- [codegen-units] codegen-units/partitioning/extern-generic.rs stdout ----



error: compilation failed!

status: exit code: 101

command: x86_64-unknown-linux-gnu/stage2/bin/rustc /build/src/test/codegen-units/partitioning/extern-generic.rs -L x86_64-unknown-linux-gnu/test/codegen-units/ --target=x86_64-unknown-linux-gnu -L x86_64-unknown-linux-gnu/test/codegen-units/partitioning/extern-generic.stage2-x86_64-unknown-linux-gnu.codegen-units.libaux -C prefer-dynamic -o x86_64-unknown-linux-gnu/test/codegen-units/partitioning/extern-generic.stage2-x86_64-unknown-linux-gnu --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt -Zprint-trans-items=eager -Zincremental=tmp/partitioning-tests/extern-generic

stdout:

------------------------------------------

TRANS_ITEM drop-glue i8 @@ extern_generic[Internal] extern_generic-mod1[Internal] extern_generic-mod1-mod1[Internal] extern_generic-mod2[Internal]

TRANS_ITEM fn cgu_generic_function::bar[0]<&str> @@ extern_generic[Internal] extern_generic-mod1[Internal] extern_generic-mod1-mod1[Internal] extern_generic-mod2[Internal]

TRANS_ITEM fn cgu_generic_function::foo[0]<&str> @@ extern_generic[Internal] extern_generic-mod1[Internal] extern_generic-mod1-mod1[Internal] extern_generic-mod2[Internal]

TRANS_ITEM fn extern_generic::mod1[0]::mod1[0]::user[0] @@ extern_generic-mod1-mod1[External]

TRANS_ITEM fn extern_generic::mod1[0]::user[0] @@ extern_generic-mod1[External]

TRANS_ITEM fn extern_generic::mod2[0]::user[0] @@ extern_generic-mod2[External]

TRANS_ITEM fn extern_generic::mod3[0]::non_user[0] @@ extern_generic-mod3[External]

TRANS_ITEM fn extern_generic::user[0] @@ extern_generic[External]

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:636

note: Run with `RUST_BACKTRACE=1` for a backtrace.

------------------------------------------

stderr:

------------------------------------------

error: internal compiler error: src/librustc_metadata/decoder.rs:75: lookup_item: id not found: DefIndex(14) in crate "cgu_generic_function" with number 11 

note: the compiler unexpectedly panicked. this is a bug. 

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports 

------------------------------------------

thread '[codegen-units] codegen-units/partitioning/extern-generic.rs' panicked at 'explicit panic', /build/src/tools/compiletest/src/runtest.rs:2353

note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:

    [codegen-units] codegen-units/partitioning/extern-generic.rs

@bors
Copy link
Contributor

bors commented Jul 30, 2016

☔ The latest upstream changes (presumably #34842) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis nikomatsakis force-pushed the incr-comp-ich-32753 branch 3 times, most recently from fc694c0 to 257b9a4 Compare August 9, 2016 18:50
@nikomatsakis
Copy link
Contributor Author

@bors r=mw

@bors
Copy link
Contributor

bors commented Aug 9, 2016

📌 Commit 257b9a4 has been approved by mw

@bors
Copy link
Contributor

bors commented Aug 9, 2016

⌛ Testing commit 257b9a4 with merge 04e0733...

@nikomatsakis
Copy link
Contributor Author

@bors r-

tidy violations

@bors
Copy link
Contributor

bors commented Aug 10, 2016

⛄ The build was interrupted to prioritize another pull request.

This requires passing in the dirty-node set explicitly since HIR nodes
wind up added to the graph either way.
@nikomatsakis
Copy link
Contributor Author

@bors r=mw

@bors
Copy link
Contributor

bors commented Aug 10, 2016

📌 Commit 83068eb has been approved by mw

@bors
Copy link
Contributor

bors commented Aug 10, 2016

⌛ Testing commit 83068eb with merge 561c4e1...

bors added a commit that referenced this pull request Aug 10, 2016
Various improvements to the SVH

This fixes a few points for the SVH:

- incorporate resolve results into the SVH;
- don't include nested items.

r? @michaelwoerister

cc #32753 (not fully fixed I don't think)
@bors bors merged commit 83068eb into rust-lang:master Aug 10, 2016
@nikomatsakis nikomatsakis deleted the incr-comp-ich-32753 branch October 3, 2016 14:55
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.

3 participants