about summary refs log tree commit diff
path: root/src/comp/middle/trans_alt.rs
AgeCommit message (Collapse)AuthorLines
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
2011-09-02Reformat. Issue #855Brian Anderson-46/+46
2011-09-02Add a constraint to trans::type_ofTim Chevalier-0/+3
trans::type_of now has a constraint saying that its type argument is statically sized. This eliminates the "impossible happened" case in type_of. Yay! I note that this change decreased translation time for stage2/rustc from 16.1 s to 14.0 s. I also think many of the remaining checks could be eliminated with some mildly clever use of constrained types and further preconditions. Future work!
2011-09-02rustc: Root values spilled via do_spill()Patrick Walton-3/+3
2011-09-01Remove lots of estr code from rustc. Issue #855Brian Anderson-1/+1
2011-09-01Add a constraint in transTim Chevalier-1/+4
Experimenting with adding typestate constraints in the compiler. Added a constraint to GEP_tag that says the variant index is in bounds. Added necessary checks.
2011-09-01Rename std::istr to std::str. Issue #855Brian Anderson-4/+4
2011-09-01Make GEP_tag take a uint instead of an intTim Chevalier-1/+1
Seems to make more sense and avoids the need for some casts.
2011-09-01Remove std::str. Issue #855Brian Anderson-1/+0
2011-09-01Allow istrs as patterns. Issue #855Brian Anderson-5/+9
2011-08-30Glob-import trans_build in other trans filesMarijn Haverbeke-22/+21
The capitalization already prevents name clashes. Being able to refer to the bitcode-construction primitives directly makes the code cleaner.
2011-08-27Convert misc compiler bits to istrs. Issue #855Brian Anderson-4/+4