summary refs log tree commit diff
path: root/src/librustc_mir/dataflow
AgeCommit message (Collapse)AuthorLines
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-163/+2
2017-08-16Cleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.Felix S. Klock II-20/+11
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
2017-08-16Added some documentation for the `struct BlockSets` in `rustc_mir::dataflow`.Felix S. Klock II-0/+19
2017-08-16MIR based borrow check (opt-in).Felix S. Klock II-4/+118
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.
2017-08-16Factored `MoveData` construction code into `builder` submodule.Felix S. Klock II-313/+334
2017-08-16Move `DataFlowState::{each_bit,interpret_set}` method definitions to parent ↵Felix S. Klock II-50/+22
module. Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of its implementation lives in `rustc_data_structures`.
2017-08-16remove now unnecessary constraint on BitDenotation for `fn do_dataflow`.Felix S. Klock II-2/+1
2017-08-16Migrated some code out of `dataflow::drop_flag_effects` and into its parent ↵Felix S. Klock II-74/+71
module. (This code is more general purpose than just supporting drop flag elaboration.)
2017-08-16Added dataflow analysis for `Borrows`.Felix S. Klock II-1/+187
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`.
2017-08-16Refactor `trait BitDenotation` to take `Location` instead of ↵Felix S. Klock II-38/+27
`BasicBlock`/`usize` argument pairs.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-17/+17
Like #43008 (f668999), but _much more aggressive_.
2017-08-12Fix some typosBastien Orivel-3/+3
2017-08-12Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperiobors-1/+1
Fix some typos I wrote a really naive script and found those typos in the documentation.
2017-08-11Fix some typosBastien Orivel-1/+1
2017-08-10For box expressions, use NZ drop instead of a free blockAriel Ben-Yehuda-17/+47
This falls naturally out of making drop elaboration work with `box` expressions, which is probably required for sane MIR borrow-checking. This is a pure refactoring with no intentional functional effects.
2017-07-30add new instructions for asserting when values are valid, and to describe ↵Ralf Jung-0/+3
when we can rely on them being locked in memory
2017-07-27erase types in the move-path abstract domainAriel Ben-Yehuda-2/+9
Leaving types unerased would lead to 2 types with a different "name" getting different move-paths, which would cause major brokenness (see e.g. #42903). This does not fix any *known* issue, but is required if we want to use abs_domain with non-erased regions (because the same can easily have different names). cc @RalfJung.
2017-07-26Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfacklerMark Simulacrum-1/+1
Make the "main" constructors of NonZero/Shared/Unique return Option Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441. This is a breaking change to unstable APIs. The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts. In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-23Fix some doc/comment typos.Bruce Mitchener-1/+1
2017-07-22Use checked NonZero constructor in MIR move path indicesSimon Sapin-1/+1
… to protect against UB in the unlikely case that `idx + 1` overflows.
2017-07-22Rename {NonZero,Shared,Unique}::new to new_uncheckedSimon Sapin-1/+1
2017-06-28Shift mir-dataflow from `rustc_borrowck` to `rustc_mir` crate.Felix S. Klock II-0/+2348
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.