- 03 3月, 2018 1 次提交
-
-
由 Manish Goregaokar 提交于
-
- 06 2月, 2018 1 次提交
-
-
由 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.
-
- 30 1月, 2018 1 次提交
-
-
由 John Kåre Alsaker 提交于
-
- 29 1月, 2018 1 次提交
-
-
由 Eduard-Mihai Burtescu 提交于
-
- 24 12月, 2017 1 次提交
-
-
由 Ariel Ben-Yehuda 提交于
-
- 21 12月, 2017 1 次提交
-
-
由 David Henningsson 提交于
The Abort Terminatorkind will cause an llvm.trap function call to be emitted. Signed-off-by: NDavid Henningsson <diwic@ubuntu.com>
-
- 14 12月, 2017 3 次提交
-
-
由 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.
-
由 Felix S. Klock II 提交于
(Still musing about whether it could make sense to revise the design here to make these constraints on usage explicit.)
-
由 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.
-
- 13 12月, 2017 1 次提交
-
-
由 Felix S. Klock II 提交于
Made `do_dataflow` and related API `pub(crate)`.
-
- 10 12月, 2017 2 次提交
-
-
由 Ariel Ben-Yehuda 提交于
If the gen/kill bits are set there, the effects of `start_block_effects` will not be seen when using `FlowAtLocation` etc. to go over the MIR. EverInitializedLvals is the only pass that got this wrong, but this fixes the footgun for everyone.
-
由 Ariel Ben-Yehuda 提交于
We can now use it in e.g. drop elaboration if we want to.
-
- 06 12月, 2017 2 次提交
-
-
由 Oliver Schneider 提交于
-
由 Ariel Ben-Yehuda 提交于
-
- 02 12月, 2017 2 次提交
-
-
由 Eduard-Mihai Burtescu 提交于
-
由 Eduard-Mihai Burtescu 提交于
-
- 27 11月, 2017 1 次提交
-
-
由 Matthew Jasper 提交于
* Used for new dataflow to track if a variable has every been initialized * Used for other dataflows that need to be updated for initializations
-
- 09 11月, 2017 1 次提交
-
-
由 Mikhail Modin 提交于
-
- 02 11月, 2017 1 次提交
-
-
由 Mikhail Modin 提交于
-
- 01 11月, 2017 1 次提交
-
-
由 Niko Matsakis 提交于
Also, factor out `do_mir_borrowck`, which is the code that actually performs the MIR borrowck from within the scope of an inference context. This change should be a pure refactoring.
-
- 14 9月, 2017 1 次提交
-
-
由 John Kåre Alsaker 提交于
-
- 19 8月, 2017 1 次提交
-
-
由 Vadim Petrochenkov 提交于
-
- 16 8月, 2017 9 次提交
-
-
由 Felix S. Klock II 提交于
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute to opt into MIR based borrow checking. Note that regardless of whether one opts in or not, AST-based borrow check will still run as well. The errors emitted from AST-based borrow check will include a "(Ast)" suffix in their error message, while the errors emitted from MIR-based borrow check will include a "(Mir)" suffix. post-rebase: removed check for intra-statement mutual conflict; replaced with assertion checking that at most one borrow is generated per statement. post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
-
由 Felix S. Klock II 提交于
Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of its implementation lives in `rustc_data_structures`.
-
由 Felix S. Klock II 提交于
-
由 Felix S. Klock II 提交于
(This code is more general purpose than just supporting drop flag elaboration.)
-
由 Felix S. Klock II 提交于
post-rebase: addressed review comment: rename `loc_map`/`location_map` and `rgn_map`/`region_map`. post-rebase: remove now unnecessary `mut` decl. post-rebase: address comments: bind iterator expr, and alpha-rename `loc`/`location` and `idx`/`index`.
-
由 Felix S. Klock II 提交于
-
由 Zack M. Davis 提交于
Like #43008 (f6689991), but _much more aggressive_.
-
- 12 8月, 2017 1 次提交
-
-
由 Bastien Orivel 提交于
-
- 28 7月, 2017 2 次提交
-
-
由 John Kåre Alsaker 提交于
-
由 John Kåre Alsaker 提交于
-
- 28 6月, 2017 1 次提交
-
-
由 Felix S. Klock II 提交于
Turn `elaborate_drops` and `rustc_peek` implementations into MIR passes that also live in `rustc_mir` crate. Rewire things so `rustc_driver` uses the `ElaborateDrops` from `rustc_mir` crate.
-
- 09 4月, 2017 1 次提交
-
-
由 Ariel Ben-Yehuda 提交于
This avoids creating drop flags in many unnecessary situations. Fixes #41110.
-
- 11 2月, 2017 2 次提交
-
-
由 Simonas Kazlauskas 提交于
This removes another special case of Switch by replacing it with the more general SwitchInt. While this is more clunky currently, there’s no reason we can’t make it nice (and efficient) to use.
-
由 Simonas Kazlauskas 提交于
-
- 26 12月, 2016 1 次提交
-
-
由 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.)
-
- 28 10月, 2016 1 次提交
-
-
由 Eduard Burtescu 提交于
-