1. 03 3月, 2018 1 次提交
  2. 06 2月, 2018 1 次提交
    • B
      mir: Add TerminatorKind::FalseUnwind · bdc37aa0
      bobtwinkles 提交于
      Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the
      case of infinite loops such as those introduced by a loop statement without any
      other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator
      kind is used when we want borrowck to consider an unwind path, but real control
      flow should never actually take it.
      bdc37aa0
  3. 30 1月, 2018 1 次提交
  4. 29 1月, 2018 1 次提交
  5. 24 12月, 2017 1 次提交
  6. 21 12月, 2017 1 次提交
  7. 14 12月, 2017 3 次提交
    • F
      New `ActiveBorrows` dataflow for two-phase `&mut`; not yet borrowed-checked. · ced5a701
      Felix S. Klock II 提交于
      High-level picture: The old `Borrows` analysis is now called
      `Reservations` (implemented as a newtype wrapper around `Borrows`);
      this continues to compute whether a `Rvalue::Ref` can reach a
      statement without an intervening `EndRegion`. In addition, we also
      track what `Place` each such `Rvalue::Ref` was immediately assigned
      to in a given borrow (yay for MIR-structural properties!).
      
      The new `ActiveBorrows` analysis then tracks the initial use of any of
      those assigned `Places` for a given borrow. I.e. a borrow becomes
      "active" immediately after it starts being "used" in some way. (This
      is conservative in the sense that we will treat a copy `x = y;` as a
      use of `y`; in principle one might further delay activation in such
      cases.)
      
      The new `ActiveBorrows` analysis needs to take the `Reservations`
      results as an initial input, because the reservation state influences
      the gen/kill sets for `ActiveBorrows`. In particular, a use of `a`
      activates a borrow `a = &b` if and only if there exists a path (in the
      control flow graph) from the borrow to that use. So we need to know if
      the borrow reaches a given use to know if it really gets a gen-bit or
      not.
      
       * Incorporating the output from one dataflow analysis into the input
         of another required more changes to the infrastructure than I had
         expected, and even after those changes, the resulting code is still
         a bit subtle.
      
       * In particular, Since we need to know the intrablock reservation
         state, we need to dynamically update a bitvector for the
         reservations as we are also trying to compute the gen/kills
         bitvector for the active borrows.
      
       * The way I ended up deciding to do this (after also toying with at
         least two other designs) is to put both the reservation state and
         the active borrow state into a single bitvector. That is why we now
         have separate (but related) `BorrowIndex` and
         `ReserveOrActivateIndex`: each borrow index maps to a pair of
         neighboring reservation and activation indexes.
      
      As noted above, these changes are solely adding the active borrows
      dataflow analysis (and updating the existing code to cope with the
      switch from `Borrows` to `Reservations`). The code to process the
      bitvector in the borrow checker currently just skips over all of the
      active borrow bits.
      
      But atop this commit, one *can* observe the analysis results by
      looking at the graphviz output, e.g. via
      
      ```rust
       #[rustc_mir(borrowck_graphviz_preflow="pre_two_phase.dot",
                   borrowck_graphviz_postflow="post_two_phase.dot")]
      ```
      
      Includes doc for `FindPlaceUses`, as well as `Reservations` and
      `ActiveBorrows` structs, which are wrappers are the `Borrows` struct
      that dictate which flow analysis should be performed.
      ced5a701
    • F
      Refactoring: Allow `BlockSets.on_entry` to denote locally accumulated intrablock state. · e123117c
      Felix S. Klock II 提交于
      (Still musing about whether it could make sense to revise the design
      here to make these constraints on usage explicit.)
      e123117c
    • F
      Refactoring: pull bitvector initialization out from other parts of dataflow. · d4add5d5
      Felix S. Klock II 提交于
      This is meant to ease development of multi-stage dataflow analyses
      where the output from one analysis is used to initialize the state
      for the next; in such a context, you cannot start with `bottom_value`
      for all the bits.
      d4add5d5
  8. 13 12月, 2017 1 次提交
  9. 10 12月, 2017 2 次提交
  10. 06 12月, 2017 2 次提交
  11. 02 12月, 2017 2 次提交
  12. 27 11月, 2017 1 次提交
  13. 09 11月, 2017 1 次提交
  14. 02 11月, 2017 1 次提交
  15. 01 11月, 2017 1 次提交
  16. 14 9月, 2017 1 次提交
  17. 19 8月, 2017 1 次提交
  18. 16 8月, 2017 9 次提交
  19. 12 8月, 2017 1 次提交
  20. 28 7月, 2017 2 次提交
  21. 28 6月, 2017 1 次提交
  22. 09 4月, 2017 1 次提交
  23. 11 2月, 2017 2 次提交
  24. 26 12月, 2016 1 次提交
    • F
      Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait. · a6fe6c9b
      Felix S. Klock II 提交于
      I no longer remember why I needed this (or thought I did). The way
      that the `BitDenotation` is passed around in all existing use cases
      (and planned future ones), the thing that were in the `Ctxt` can just
      be part of `Self` instead.
      
      (I think ariel had been pushing me to do this back when I first put in
      this infrastructure; it took me a while to see how much of pain the
      `Ctxt` was causing.)
      a6fe6c9b
  25. 28 10月, 2016 1 次提交