-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Some preliminary work towards making trans "collector driven". #33171
Conversation
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -52,7 +52,7 @@ impl BitVector { | |||
|
|||
pub fn grow(&mut self, num_bits: usize) { | |||
let num_words = u64s(num_bits); | |||
let extra_words = self.data.len() - num_words; | |||
let extra_words = (num_words as i64) - (self.data.len() as i64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.data.len() < num_words { self.data.resize(num_words, 0) }
instead?
Also needs a regression test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be nicer. I'll add the test too.
625f97e
to
e6d3ac3
Compare
Changed the implementation of |
@@ -9,7 +9,7 @@ | |||
// except according to those terms. | |||
|
|||
// ignore-tidy-linelength | |||
// compile-flags:-Zprint-trans-items=eager | |||
// compile-flags:-Zprint-trans-items=eager -Zincremental="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why -Z incremental=""
?
@bors r+ |
📌 Commit e6d3ac3 has been approved by |
…tsakis Some preliminary work towards making trans "collector driven". The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality: 1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`. 2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today. 3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented). It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
I'll take the failed test as an opportunity to address the nits. |
e6d3ac3
to
0fc9f9a
Compare
@bors r=nikomatsakis |
📌 Commit 0fc9f9a has been approved by |
…tsakis Some preliminary work towards making trans "collector driven". The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality: 1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`. 2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today. 3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented). It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.
Mono collector: replace pair of ints with Range I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`. I'm hoping there are no technical reasons to not do this.
Mono collector: replace pair of ints with Range I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`. I'm hoping there are no technical reasons to not do this.
Mono collector: replace pair of ints with Range I found the initial PR (rust-lang#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`. I'm hoping there are no technical reasons to not do this.
The
trans::collector
already collects all translation items andtrans::partitioning
distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:DropGlueKind::Ty
andDropGlueKind::TyContents
.FixedUnitCount
strategy which more or less corresponds to the partitioning one gets via supplying-Ccodegen-units
today.It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.