summary refs log tree commit diff
path: root/src/librustc/middle/dataflow.rs
AgeCommit message (Collapse)AuthorLines
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-1/+1
2018-07-12rename `graph` to `control_flow_graph::implementation`Niko Matsakis-1/+1
2017-10-08address more FIXME whose associated issues were marked as closedNiv Kaminer-1/+1
update FIXME(#6298) to point to open issue 15020 update FIXME(#6268) to point to RFC 811 update FIXME(#10520) to point to RFC 1751 remove FIXME for emscripten issue 4563 and include target in `test_estimate_scaling_factor` remove FIXME(#18207) since node_id isn't used for `ref` pattern analysis remove FIXME(#6308) since DST was implemented in #12938 remove FIXME(#2658) since it was decided to not reorganize module remove FIXME(#20590) since it was decided to stay conservative with projection types remove FIXME(#20297) since it was decided that solving the issue is unnecessary remove FIXME(#27086) since closures do correspond to structs now remove FIXME(#13846) and enable `function_sections` for windows remove mention of #22079 in FIXME(#22079) since this is a general FIXME remove FIXME(#5074) since the restriction on borrow were lifted
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CFG.Eduard-Mihai Burtescu-47/+49
2017-08-07rustc::middle::dataflow - visit the CFG in RPOAriel Ben-Yehuda-4/+13
We used to propagate bits in node-id order, which sometimes caused an excessive number of iterations, especially when macros were present. As everyone knows, visiting the CFG in RPO bounds the number of iterators by 1 plus the depth of the most deeply nested loop (times the height of the lattice, which is 1). Fixes #43704.
2017-07-11Refactor methods onto Printer struct.Mark Simulacrum-2/+1
No (intentional) changes to behavior. This is intended to avoid the anti-pattern of having to import individual methods throughout code.
2017-07-05use field init shorthand in src/librustcZack M. Davis-8/+8
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-1/+1
2016-12-28rustc: always print nested nodes where a HIR map is available.Eduard-Mihai Burtescu-14/+8
2016-12-28rustc: move function arguments into hir::Body.Eduard-Mihai Burtescu-11/+15
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-4/+4
2016-11-29revamp `Visitor` with a single method for controlling nested visitsNiko Matsakis-1/+3
2016-11-29Split nested_visit_mode function off from nested_visit_mapFlorian Diebold-0/+2
... and make the latter mandatory to implement.
2016-11-10rustc: use an Expr instead of a Block for function bodies.Eduard Burtescu-4/+4
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-2/+2
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-3/+2
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-05-16fix bug in `debug!` output from `rustc::middle::dataflow`Felix S. Klock II-2/+2
(bug was cut/pasted into `rustc_borrowck::bitslice`, so I fixed it there as well.)
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-2/+2
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-2/+2
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-2/+1
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-3/+3
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-3/+3
2016-03-22try! -> ?Jorge Aparicio-6/+6
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-21scaffolding for borrowck on MIR.Felix S. Klock II-1/+1
emit (via debug!) scary message from `fn borrowck_mir` until basic prototype is in place. Gather children of move paths and set their kill bits in dataflow. (Each node has a link to the child that is first among its siblings.) Hooked in libgraphviz based rendering, including of borrowck dataflow state. doing this well required some refactoring of the code, so I cleaned it up more generally (adding comments to explain what its trying to do and how it is doing it). Update: this newer version addresses most review comments (at least the ones that were largely mechanical changes), but I left the more interesting revisions to separate followup commits (in this same PR).
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-3/+3
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-2/+2
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-01-25librustc/middle/dataflow.rs: Debug to STDERRAdrian Heine-2/+1
In 95d904625b4d45af80b4e40d51a3a0fde1abaa8a output was accidentally moved from STDERR to STDOUT. This commit also changes the order of debug output. Previously, it was: ``` /* id 22: … */ { … } DEBUG:rustc::middle::dataflow: ``` Now, it is: ``` DEBUG:rustc::middle::dataflow: /* id 22: … */ { … } ```
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-6/+10
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2015-11-24Use the EntryOrExit variants qualified.Ms2ger-5/+3
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-5/+5
straightforward uses of `visit_all_items`. In some cases I had to remove empty `visit_item` calls that were just to suppress visiting nested items.
2015-09-23Remove random Idents outside of libsyntaxVadim Petrochenkov-1/+1
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-0/+1
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-03Add an intital HIR and lowering stepNick Cameron-8/+11
2015-07-09Use vec![elt; n] where possibleUlrik Sverdrup-7/+6
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is exactly equivalent to `vec![elt; n]`, do this replacement in the whole tree. (Actually, vec![] is smart enough to only call clone n - 1 times, while the former solution would call clone n times, and this fact is virtually irrelevant in practice.)
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-04-17Port to using the newer graph, which offers iterators instead of theNiko Matsakis-3/+2
older `each` method, but is otherwise identical.
2015-04-15Dataflow changes and associated borrowck fix.Felix S. Klock II-17/+63
Revise rustc::middle::dataflow: one must select kill-kind when calling add_kill. The current kill-kinds are (1.) kills associated with ends-of-scopes and (2.) kills associated with the actual action of the expression/pattern. Then, use this to fix borrowck analysis so that it will not treat a break that pops through an assignment `x = { ... break; ... }` as a kill of the "moved-out" bit for `x`. Fix #24267. (incorporated review feedback.)
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-4/+4
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-1/+1
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Fallout out rustcNiko Matsakis-1/+1
2015-04-01Pretty print ids for assoc itemsNick Cameron-1/+1
2015-03-30Remove unnecessary `as usize`Vadim Petrochenkov-4/+4
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-28/+28
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27default => or_insert per RFCAlexis Beingessner-2/+2
2015-03-26update everything to use Entry defaultsAlexis-12/+2
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-28/+28
Now that support has been removed, all lingering use cases are renamed.
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-5/+7
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-02core: Audit num module for int/uintBrian Anderson-5/+5
* count_ones/zeros, trailing_ones/zeros return u32, not usize * rotate_left/right take u32, not usize * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize Doesn't touch pow because there's another PR for it. [breaking-change]
2015-02-22Add support for mapping a single ast-node to multiple cfg-nodes.James Miller-39/+67
This is necessary for e.g. supporting the cfgs we plan to construct for match under aatch's plan. (Factoring of aatch CFG code, Part 3.)
2015-02-22Distinguish between AST and various Dummy nodes in CFG.James Miller-3/+3
(Factoring of aatch CFG code, Part 1.)