about summary refs log tree commit diff
path: root/src/comp/middle/last_use.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-373/+0
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-1/+1
2012-02-29Recognize last uses for copied closed-over variablesMarijn Haverbeke-75/+127
And clean up and fix some bad things in last_use.rs. Closes #1894
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-6/+6
2012-02-22Remove preconditions from librariesMarijn Haverbeke-1/+0
Closes #1805
2012-02-15make mut a keyword synonymous with mutableNiko Matsakis-2/+2
first step towards issue #1273
2012-02-15Support 'alt check' syntaxMarijn Haverbeke-1/+1
It is only a way to flag an alt as intentionally non-exhaustive right now. Issue #1679
2012-02-13Fix bug in handling of block functions in last-use analysisMarijn Haverbeke-2/+6
It would fail to start out with a fresh scope when going over a loop or block function for the second time, and thus not recognize last uses of locals defined inside the block. Closes #1818
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-1/+1
2012-02-09Remove some pointless importsMarijn Haverbeke-1/+0
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-3/+3
It is now no longer needed to have a ty::ctxt to get at the contents of a ty::t. The straight-forward approach of doing this, simply making ty::t a box type, unfortunately killed our compiler performance (~15% slower) through refcounting cost. Thus, this patch now represents ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds these boxes alive, outlives any uses of the ty::t values. In the current compiler this trivially holds, but it is does of course add a new potential pitfall. ty::get takes a ty::t and returns a boxed representation of the type. I've changed calls to ty::struct(X) to do ty::get(X).struct. Type structs are full of vectors, and copying them every time we wanted to access them was a bit of a cost.
2012-02-05infer modes rather than overwriting with expected tyNiko Matsakis-3/+13
2012-01-31Change option::t to optionTim Chevalier-1/+1
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
2012-01-31Require alts to be exhaustiveTim Chevalier-0/+6
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-30Remove ternary operatorPaul Woolcock-3/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-30Substitute type parameters more eagerlyMarijn Haverbeke-1/+1
This simplifies the typechecker a bit (no more ty_param_substs_opt_and_ty) and is needed for another experiment I'm playing with. I hope it also makes compilation faster (the bots will tell).
2012-01-23s/block()/fn()/gNiko Matsakis-1/+1
2012-01-19rustc: ";" to "," in enumsPatrick Walton-2/+2
2012-01-19rustc: "tag" -> "enum"Patrick Walton-2/+2
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-6/+6
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-6/+13
2012-01-09Change all uses of 'when' in alt-patterns to 'if'Austin Seipp-1/+1
Issue #1396
2012-01-08modify last use to take into account cap clause, add new testNiko Matsakis-8/+25
2012-01-06Disallow variable names that shadow tags in scopeTim Chevalier-3/+3
Now, if you have a tag named "foo", a variable declaration like "let foo..." is illegal. This change makes it possible to eliminate the '.' after a nullary tag pattern in an alt (but I'll be doing that in a future commit) -- as now it's always obvious whether a name refers to a tag or a new declared variable. resolve implements this change -- all the other changes are just to get rid of existing code that declares variables that shadow tag names.
2012-01-03Merge pull request #1392 from Lenny222/listBrian Anderson-2/+4
list: add "is_not_empty" requirement to "head" and "tail" (analogous to "vec")
2012-01-02Make last-use pass properly handle closed-over variablesMarijn Haverbeke-3/+18
Closes #1399
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-5/+5
this will address the (crashing) new test added.
2011-12-29list: use predicate to enforce non-empty requirementLenny222-2/+4
2011-12-23Go back to a single visit_fn function in visit.rsMarijn Haverbeke-6/+6
2011-12-22Unify some data structures in syntax::ast that were doing the same thingMarijn Haverbeke-1/+1
As a preparation to removing some duplication in typeck.
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-6/+11
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-3/+3
2011-12-14first attempt, not happy with itNiko Matsakis-1/+2
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-1/+2
2011-12-01Fix mistake in last use passMarijn Haverbeke-5/+12
Closes #1243
2011-11-21Fix bad interaction between last-use finding and referencesMarijn Haverbeke-6/+14
The last-use pass now takes input from the alias pass to not mark things as last uses that are still accessed through a reference. Issue #925
2011-11-18Add some comments to kind.rs and last_use.rsMarijn Haverbeke-0/+18
2011-11-18Make trans use last_use info to not actually generate copiesMarijn Haverbeke-1/+7
Issue #925
2011-11-18Implement a last-use-of-local finding algorithmMarijn Haverbeke-0/+219
Issue #925