summary refs log tree commit diff
path: root/src/librustc/middle/dataflow.rs
AgeCommit message (Collapse)AuthorLines
2014-09-16Fallout from renamingAaron Turon-6/+6
2014-09-12Track the visited AST's lifetime throughout Visitor.Eduard Burtescu-1/+1
2014-09-12Remove largely unused context from Visitor.Eduard Burtescu-4/+4
2014-09-08rustc: fix fallout from the addition of a 'tcx lifetime on tcx.Eduard Burtescu-12/+12
2014-08-30auto merge of #16859 : alexcrichton/rust/snapshots, r=huonwbors-7/+0
2014-08-30rustc: implement a pretty mode to print ident/name's ctxt & gensyms.Huon Wilson-0/+1
`--pretty expanded,hygiene` is helpful with debugging macro issues, since two identifiers/names can be textually the same, but different internally (resulting in weird "undefined variable" errors).
2014-08-29Register new snapshotsAlex Crichton-7/+0
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-1/+8
2014-07-18Removed the `_frozen` methods from dataflow API.Felix S. Klock II-46/+38
Calls to methods like `each_bit_on_entry_frozen` and `each_gen_bit_frozen` now go to the `each_bit_on_entry` and `each_gen_bit` methods.
2014-07-18Removed `index_to_bitset` from the dataflow context.Felix S. Klock II-56/+15
Part of addressing 15019.
2014-07-17Rename functions in the CloneableVector traitAdolfo OchagavĂ­a-2/+2
* Deprecated `to_owned` in favor of `to_vec` * Deprecated `into_owned` in favor of `into_vec` [breaking-change]
2014-07-15Extend --pretty flowgraph=ID to include dataflow results in output.Felix S. Klock II-13/+56
Use one or more of the following `-Z` flag options to tell the graphviz renderer to include the corresponding dataflow sets (after the iterative constraint propagation reaches a fixed-point solution): * `-Z flowgraph-print-loans` : loans computed via middle::borrowck * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data * `-Z flowgraph-print-all` : all of the available sets are included. Fix #15016. ---- This also adds a module, `syntax::ast_map::blocks`, that captures a common abstraction shared amongst code blocks and procedure-like things. As part of this, moved `ast_map.rs` to subdir `ast_map/mod.rs`, to follow our directory layout conventions. (incorporated review feedback from huon, acrichto.)
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-17/+17
[breaking-change]
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-1/+1
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-18Ensure dataflow of a proc never looks at blocks from closed-over context.Felix S. Klock II-24/+14
Details: in a program like: ``` type T = proc(int) -> int; /* 4 */ pub fn outer(captured /* pat 16 */: T) -> T { (proc(x /* pat 23 */) { ((captured /* 29 */).foo((x /* 30 */)) /* 28 */) } /* block 27 */ /* 20 */) } /* block 19 */ /* 12 */ ``` the `captured` arg is moved from the outer fn into the inner proc (id=20). The old dataflow analysis for flowed_move_data_moves, when looking at the inner proc, would attempt to add a kill bit for `captured` at the end of its scope; the problem is that it thought the end of the `captured` arg's scope was the outer fn (id=12), even though at that point in the analysis, the `captured` arg's scope should now be restricted to the proc itself (id=20). This patch fixes handling of upvars so that dataflow of a fn/proc should never attempts to add a gen or kill bit to any NodeId outside of the current fn/proc. It accomplishes this by adding an `LpUpvar` variant to `borrowck::LoanPath`, so for cases like `captured` above will carry both their original `var_id`, as before, as well as the `NodeId` for the closure that is capturing them. As a drive-by fix to another occurrence of a similar bug that nikomatsakis pointed out to me earlier, this also fixes `gather_loans::compute_kill_scope` so that it computes the kill scope of the `captured` arg to be block 27; that is, the block for the proc itself (id=20). (This is an updated version that generalizes the new loan path variant to cover all upvars, and thus renamed the variant from `LpCopiedUpvar` to just `LpUpvar`.)
2014-06-18Revise dataflow to do a cfg-driven walk.Felix S. Klock II-576/+296
Fix #6298. This is instead of the prior approach of emulating cfg traversal privately by traversing AST in same way). Of special note, this removes a special case handling of `ExprParen` that was actually injecting a bug (since it was acting like an expression like `(*func)()` was consuming `*func` *twice*: once from `(*func)` and again from `*func`). nikomatsakis was the first one to point out that it might suffice to simply have the outer `ExprParen` do the consumption of the contents (alone). (This version has been updated to incorporate feedback from Niko's review of PR 14873.)
2014-06-13Fix all violations of stronger guarantees for mutable borrowsCameron Zwarich-1/+2
Fix all violations in the Rust source tree of the stronger guarantee of a unique access path for mutable borrows as described in #12624.
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-13/+14
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-58/+58
2014-06-06Move Def out of syntax crate, where it does not belongNiko Matsakis-3/+4
2014-05-28std: Remove format_strbuf!()Alex Crichton-6/+3
This was only ever a transitionary macro.
2014-05-27std: Rename strbuf operations to stringRicho Healey-2/+2
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-5/+5
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-8/+13
2014-05-12librustc: Remove all uses of `~str` from librustc.Patrick Walton-7/+10
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-2/+2
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-1/+1
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-1/+1
2014-04-22rustc: move the method and vtable maps into ty::ctxt.Eduard Burtescu-4/+1
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-2/+2
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-4/+3
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-3/+4
port all code over to use it.
2014-04-04syntax: remove obsolete mutability from ExprVec and ExprRepeat.Eduard Burtescu-2/+2
2014-04-02middle: dataflow: remove dead codeCorey Richardson-25/+0
2014-03-31rustc: Switch field privacy as necessaryAlex Crichton-9/+10
2014-03-22rustc: Fix fallout of removing get()Alex Crichton-3/+2
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-2/+2
Closes #12702
2014-03-18syntax: Don't parameterize the the pretty printerAlex Crichton-1/+1
The pretty printer constitues an enormous amount of code, there's no reason for it to be generic. This just least to a huge amount of metadata which isn't necessary. Instead, this change migrates the pretty printer to using a trait object instead. Closes #12985
2014-03-17Refactor pprust a bit.Eduard Burtescu-14/+14
2014-03-17De-@ ty::ctxt usage.Eduard Burtescu-13/+13
2014-03-15rustc: Remove compiler support for __log_level()Alex Crichton-1/+0
This commit removes all internal support for the previously used __log_level() expression. The logging subsystem was previously modified to not rely on this magical expression. This also removes the only other function to use the module_data map in trans, decl_gc_metadata. It appears that this is an ancient function from a GC only used long ago. This does not remove the crate map entirely, as libgreen still uses it to hook in to the event loop provided by libgreen.
2014-03-13Implement automatic overloaded dereference.Eduard Burtescu-2/+2
Closes #7141.
2014-03-08librustc: Fix up fallout from the automatic conversion.Felix S. Klock II-11/+17
2014-03-08librustc: Automatically change uses of `~[T]` to `Vec<T>` in rustc.Patrick Walton-20/+18
2014-03-06rustc: Move to FNV hashing for node/def idsAlex Crichton-3/+3
This leverages the new hashing framework and hashmap implementation to provide a much speedier hashing algorithm for node ids and def ids. The hash algorithm used is currentl FNV hashing, but it's quite easy to swap out. I originally implemented hashing as the identity function, but this actually ended up in slowing down rustc compiling libstd from 8s to 13s. I would suspect that this is a result of a large number of collisions. With FNV hashing, we get these timings (compiling with --no-trans, in seconds): | | before | after | |-----------|---------:|--------:| | libstd | 8.324 | 6.703 | | stdtest | 47.674 | 46.857 | | libsyntax | 9.918 | 8.400 |
2014-03-03syntax: make match arms store the expr directly.Huon Wilson-2/+1
Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an `ast::Block` (for historical reasons, AIUI), so we might as just store that expr directly. Closes #3085.
2014-03-01librustc: Fix errors arising from the automated `~[T]` conversionPatrick Walton-5/+7
2014-02-26Replace callee_id with information stored in method_map.Eduard Burtescu-16/+15