1. 17 6月, 2016 1 次提交
    • S
      Cache drops for early scope exits · 04d63ccf
      Simonas Kazlauskas 提交于
      Previously we would rebuild all drops on every early exit from a scope, which for code like:
      
      ```rust
      match x {
          a => return 1,
          b => return 2,
          ...
          z => return 27
      }
      ```
      
      would produce 27 exactly same chains of drops for each return, a O(n*m) explosion in drops.
      04d63ccf
  2. 09 6月, 2016 2 次提交
  3. 08 6月, 2016 1 次提交
  4. 07 6月, 2016 1 次提交
  5. 05 6月, 2016 1 次提交
  6. 03 6月, 2016 1 次提交
    • A
      introduce DropAndReplace for translating assignments · de7cb0fd
      Ariel Ben-Yehuda 提交于
      this introduces a DropAndReplace terminator as a fix to #30380. That terminator
      is suppsoed to be translated by desugaring during drop elaboration, which is
      not implemented in this commit, so this breaks `-Z orbit` temporarily.
      de7cb0fd
  7. 11 5月, 2016 3 次提交
  8. 28 4月, 2016 1 次提交
    • J
      Various improvements to MIR and LLVM IR Construction · f242fe3c
      James Miller 提交于
      Primarily affects the MIR construction, which indirectly improves LLVM
      IR generation, but some LLVM IR changes have been made too.
      
      * Handle "statement expressions" more intelligently. These are
        expressions that always evaluate to `()`. Previously a temporary would
        be generated as a destination to translate into, which is unnecessary.
      
        This affects assignment, augmented assignment, `return`, `break` and
        `continue`.
      * Avoid inserting drops for non-drop types in more places. Scheduled
        drops were already skipped for types that we knew wouldn't need
        dropping at construction time. However manually-inserted drops like
        those for `x` in `x = y;` were still generated. `build_drop` now takes
        a type parameter like its `schedule_drop` counterpart and checks to
        see if the type needs dropping.
      * Avoid generating an extra temporary for an assignment where the types
        involved don't need dropping. Previously an expression like
        `a = b + 1;` would result in a temporary for `b + 1`. This is so the
        RHS can be evaluated, then the LHS evaluated and dropped and have
        everything work correctly. However, this isn't necessary if the `LHS`
        doesn't need a drop, as we can just overwrite the existing value.
      * Improves lvalue analysis to allow treating an `Rvalue::Use` as an
        operand in certain conditions. The reason for it never being an
        operand is so it can be zeroed/drop-filled, but this is only true for
        types that need dropping.
      
      The first two changes result in significantly fewer MIR blocks being
      generated, as previously almost every statement would end up generating
      a new block due to the drop of the `()` temporary being generated.
      f242fe3c
  9. 13 4月, 2016 1 次提交
  10. 12 4月, 2016 1 次提交
  11. 01 4月, 2016 1 次提交
  12. 30 3月, 2016 2 次提交
  13. 27 3月, 2016 2 次提交
  14. 24 3月, 2016 14 次提交
  15. 10 3月, 2016 1 次提交
  16. 09 3月, 2016 1 次提交
  17. 03 3月, 2016 1 次提交
  18. 25 2月, 2016 1 次提交
    • S
      Make list of statements flat · 77be4ecc
      Simonas Kazlauskas 提交于
      In MIR we previously tried to match `let x in { exprs; let y in { exprs; }}` with our data
      structures which is rather unwieldy, espeicially because it requires some sort of recursion or
      stack to process, while, a flat list of statements is enough – lets only relinquish their lifetime
      at the end of the block (i.e. end of the list).
      
      Also fixes #31853.
      77be4ecc
  19. 20 2月, 2016 2 次提交
  20. 13 2月, 2016 1 次提交
  21. 11 2月, 2016 1 次提交