about summary refs log tree commit diff
path: root/src/comp/middle/trans_alt.rs
AgeCommit message (Collapse)AuthorLines
2012-01-27Move various trans_ modules under a trans:: umbrella moduleMarijn Haverbeke-782/+0
Closes #1304
2012-01-27Stop passing spans to middle::trans functions that don't need themMarijn Haverbeke-1/+1
Removes a bunch of (eventually) unused arguments. Makes span passing to debuginfo explicit, instead of relying on the (usually incorrect) spans held in the contexts. Closes #1439
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-18/+18
This should reduce confusion of people trying to read the code.
2012-01-21issue #1352: change param order on vec::init_elt, putting block in final ↵Graham Fawcett-4/+4
position. To match the init_fn() and init_fn_mut() changes.
2012-01-19Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. ↵Graydon Hoare-2/+2
Close #1428.
2012-01-19rustc: ";" to "," in enumsPatrick Walton-4/+4
2012-01-19rustc: Fix long linesPatrick Walton-1/+2
2012-01-19rustc: "tag" -> "enum"Patrick Walton-5/+5
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-10/+10
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-19/+39
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-5/+3
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
2011-12-18Only look for a matching method when normal field access failsMarijn Haverbeke-4/+2
We should probalby warn when defining a method foo on {foo: int} etc. This should reduce the amount of useless typevars that are allocated. Issue #1227
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-1/+1
2011-12-15rustc: Box the vectors returned from ty::tag_variantsBrian Anderson-3/+3
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-1/+1
2011-12-08Allow binding of nested patternsMarijn Haverbeke-19/+49
See src/test/run-pass/nested-patterns.rs for some examples. The syntax is boundvar@subpattern Which will match the subpattern as usual, but also bind boundvar to the whole matched value. Closes #838
2011-12-02Allow literal patterns to contain arbitrary literal expressionsMarijn Haverbeke-29/+17
This removes the need for the unary minus hacks, and allows some other neat things like matching on 1 >> 4. Issue #954
2011-11-22Fix inconsistency in ordering of patterns during alt compilationMarijn Haverbeke-17/+12
Closes #1153
2011-11-22Only warn about unreachable range patterns when appropriateMarijn Haverbeke-2/+1
Also simplifies the literal-munging, and moves it into ast_util Closes #1170
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-10Cleanup unused importsHaitao Li-4/+2
2011-11-03Disallow writing to function arguments againMarijn Haverbeke-8/+8
Remove implicit copying hack. Closes #1118
2011-11-02convert GEP to i32Niko Matsakis-10/+4
2011-11-02thread the context through so that int can be 64 bits on x86_64Niko Matsakis-9/+13
2011-11-02Evaluate alt expressions in their own block contextMarijn Haverbeke-3/+10
Closes #785
2011-10-21Move hash table iteration over to block-taking functionsMarijn Haverbeke-6/+6
Issue #1056
2011-10-20Make fn denote a bare function. Convert fn to fn@ as neededBrian Anderson-2/+2
2011-10-18Don't try to build an LLVM switch on floatsMarijn Haverbeke-1/+2
Closes #1046
2011-10-10Make vectors and strings immediates againMarijn Haverbeke-6/+7
There's no good reason to force them to be spilled anymore. Some pieces of trans become more elegant this way, and less stack allocs and load/stores are needed. Issue #1021
2011-10-07Make it possible to have locals that don't live on the stackMarijn Haverbeke-13/+14
Local values that are not mutated, don't need to be cleaned up, and are immediate, don't need to be spilled. (All immediate args, and non-pointer immediate let locals.)
2011-10-05Add trans_temp_expr for what used to be trans_expr, rename t_e_dps to trans_exprMarijn Haverbeke-2/+2
Issue #667
2011-09-28Revert "Revert "Implement pattern ranges for all numeric types.""Brian Anderson-21/+82
This reverts commit a034f87146e60e1db2327c6f6807c47406a1bb0b. Conflicts: src/comp/middle/check_alt.rs src/comp/middle/trans_alt.rs src/comp/syntax/ast.rs src/comp/syntax/ast_util.rs src/comp/syntax/fold.rs src/comp/syntax/print/pprust.rs Conflicts: src/comp/middle/trans_alt.rs
2011-09-27Fix lurking bug in matching of nilMarijn Haverbeke-6/+6
Which was somehow made visible by the DPS changes.
2011-09-27Move expr_binary into trans_expr_dpsMarijn Haverbeke-2/+3
Issue #667
2011-09-27Move expr_lit and expr_vec into trans_expr_dpsMarijn Haverbeke-1/+13
Issue #667
2011-09-23Add let destructuring for unique boxesBrian Anderson-0/+4
Issue #409
2011-09-23Begin to support pattern matching on unique boxesBrian Anderson-0/+25
Issue #409
2011-09-23Properly mark unreachable alt bodies as unreachableMarijn Haverbeke-0/+2
2011-09-23Start on a piecemeal conversion to DPSMarijn Haverbeke-9/+7
Issue #667 Wires in a basic framework for destination-passing style, with backwards-compatibility to the old approach, so that expression types can be moved over to it one at a time (by moving them from trans_expr to trans_expr_dps).
2011-09-23Better handling of unreachable code in transMarijn Haverbeke-17/+17
The builder functions in trans_build now look at an 'unreachable' flag in the block context and don't generate code (returning undefined placeholder values) when this flag is set. Threading the unreachable flag through context still requires some care, but this seems a more sane approach than re-checking for terminated blocks throughout the compiler. When creating a block, if you use its closest dominator as parent, the flag will be automatically passed through. If you can't do that, because the dominator is a scope block that you're trying to get out of, you'll have to do something like this to explicitly pass on the flag: if bcx.unreachable { Unreachable(next_cx); } Closes #949. Closes #946. Closes #942. Closes #895. Closes #894. Closes #892. Closes #957. Closes #958.
2011-09-21Revert "Implement pattern ranges for all numeric types."Marijn Haverbeke-78/+20
This reverts commit ce0f054f9d56df4e60291fc2e1b89ce979cf374f.
2011-09-21Implement pattern ranges for all numeric types.Josh Matthews-20/+78
2011-09-17Add a precondition to GEP_tup_likeTim Chevalier-0/+8
2011-09-15Added an extra check in trans_altTim Chevalier-0/+1
Gratuitous right now, but I'm going to change the type of trans::type_of
2011-09-13Make for loop alias-safeMarijn Haverbeke-1/+1
2011-09-13Apply implicit copying for unsafe references to alt patternsMarijn Haverbeke-4/+19
2011-09-12Factor imports mindlessly.Graydon Hoare-11/+4
2011-09-12Pretty-print for new arg-mode syntaxMarijn Haverbeke-2/+2
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-39/+40
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-08rustc: Make unique pointers no longer immediates.Patrick Walton-2/+4