schedule drops on bindings only after initializing them

This reduces the number of dynamic drops in libstd from 1141 to 899.
However, without this change, the next patch would have created much
more dynamic drops.

A basic merge unswitching hack reduced the number of dynamic drops to
644, with no effect on stack usage. I should be writing a more dedicated
drop unswitching pass.

No performance measurements.
This commit is contained in:
Ariel Ben-Yehuda 2017-02-26 16:21:26 +02:00
parent 5907ed63d3
commit 6755fb8ba2
5 changed files with 98 additions and 72 deletions

View file

@ -31,8 +31,8 @@ fn main() {
// _3 = &_4;
// StorageDead(_5);
// _2 = ();
// StorageDead(_4);
// StorageDead(_3);
// StorageDead(_4);
// StorageLive(_6);
// _6 = const 1i32;
// _0 = ();