1. 05 3月, 2018 1 次提交
  2. 06 12月, 2017 2 次提交
  3. 02 12月, 2017 2 次提交
  4. 15 9月, 2017 1 次提交
  5. 05 9月, 2017 2 次提交
  6. 02 9月, 2017 1 次提交
  7. 16 8月, 2017 1 次提交
  8. 12 6月, 2017 1 次提交
    • F
      Add `EndRegion` statement kind to MIR. · 1d315cf7
      Felix S. Klock II 提交于
       * Emit `EndRegion` for every code-extent for which we observe a
         borrow. To do this, we needed to thread source info back through
         to `fn in_scope`, which makes this commit a bit more painful than
         one might have expected.
      
       * There is `end_region` emission in `Builder::pop_scope` and in
         `Builder::exit_scope`; the first handles falling out of a scope
         normally, the second handles e.g. `break`.
      
       * Remove `EndRegion` statements during the erase_regions mir
         transformation.
      
       * Preallocate the terminator block, and throw an `Unreachable` marker
         on it from the outset. Then overwrite that Terminator as necessary
         on demand.
      
       * Instead of marking the scope as needs_cleanup after seeing a
         borrow, just treat every scope in the chain as being part of the
         diverge_block (after any *one* of them has separately signalled
         that it needs cleanup, e.g. due to having a destructor to run).
      
       * Allow for resume terminators to be patched when looking up drop flags.
      
         (In particular, `MirPatch::new` has an explicit code path,
         presumably previously unreachable, that patches up such resume
         terminators.)
      
       * Make `Scope` implement `Debug` trait.
      
       * Expanded a stray comment: we do not emit StorageDead on diverging
         paths, but that end behavior might not be desirable.
      1d315cf7
  9. 12 5月, 2017 1 次提交
    • A
      box large variants in MIR · c85501b9
      Ariel Ben-Yehuda 提交于
      Operand: 72 -> 24 B
      Statement: 192 -> 96 B
      Terminator: 256 -> 112 B
      librustc translation memory usage: 1795 -> 1669 MB
      
      next step would be interning lvalues, I suppose?
      c85501b9
  10. 02 4月, 2017 1 次提交
    • A
      mark build::cfg::start_new_block as inline(never) · 09ac56d6
      Ariel Ben-Yehuda 提交于
      LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
      circumstances. The function `start_new_block` has allocas totalling 1216
      bytes, and when LLVM inlines several copies of that function into
      the recursive function `expr::into`, that function's stack space usage
      goes into tens of kiBs, causing stack overflows.
      
      Mark `start_new_block` as inline(never) to keep it from being inlined,
      getting stack usage under control.
      
      Fixes #40493.
      Fixes #40573.
      09ac56d6
  11. 14 11月, 2016 1 次提交
  12. 28 10月, 2016 1 次提交
  13. 19 8月, 2016 1 次提交
  14. 10 6月, 2016 1 次提交
  15. 09 6月, 2016 1 次提交
  16. 08 6月, 2016 1 次提交
  17. 07 6月, 2016 1 次提交
  18. 05 6月, 2016 2 次提交
  19. 24 3月, 2016 4 次提交
  20. 04 2月, 2016 3 次提交
    • S
      Convert Drop statement into terminator · 98265d33
      Simonas Kazlauskas 提交于
      The structure of the old translator as well as MIR assumed that drop glue cannot possibly panic and
      translated the drops accordingly. However, in presence of `Drop::drop` this assumption can be
      trivially shown to be untrue. As such, the Rust code like the following would never print number 2:
      
      ```rust
      struct Droppable(u32);
      impl Drop for Droppable {
          fn drop(&mut self) {
              if self.0 == 1 { panic!("Droppable(1)") } else { println!("{}", self.0) }
          }
      }
      fn main() {
          let x = Droppable(2);
          let y = Droppable(1);
      }
      ```
      
      While the behaviour is allowed according to the language rules (we allow drops to not run), that’s
      a very counter-intuitive behaviour. We fix this in MIR by allowing `Drop` to have a target to take
      on divergence and connect the drops in such a way so the leftover drops are executed when some drop
      unwinds.
      
      Note, that this commit still does not implement the translator part of changes necessary for the
      grand scheme of things to fully work, so the actual observed behaviour does not change yet. Coming
      soon™.
      
      See #14875.
      98265d33
    • S
      Change successor{,_mut} to return a Vec · 02365fe7
      Simonas Kazlauskas 提交于
      This helps to avoid the unpleasant restriction of being unable to have multiple successors in
      non-contiguous block of memory.
      02365fe7
    • S
      Synthesize calls to box_free language item · 432460a6
      Simonas Kazlauskas 提交于
      This gets rid of Drop(Free, _) MIR construct by synthesizing a call to language item which
      takes care of dropping instead.
      432460a6
  21. 07 1月, 2016 1 次提交
  22. 06 1月, 2016 1 次提交
  23. 30 11月, 2015 1 次提交
  24. 25 11月, 2015 1 次提交
  25. 07 10月, 2015 1 次提交
    • M
      Partially format librustc_mir with rustfmt. · c73e78ce
      Ms2ger 提交于
      This commit contains some of the changes proposed by a rustfmt invocation,
      chosen based on the fairly non-deterministic metric of how much I liked the
      change. I expect we will run rustfmt on this crate again later, probably
      accepting more of its changes. For now, this is already an improvement over
      the status-quo.
      c73e78ce
  26. 06 10月, 2015 1 次提交
  27. 06 9月, 2015 1 次提交