about summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2011-08-26Pass stuff to take_ty, free_ty, and drop_ty by address, even when immediateMarijn Haverbeke-39/+29
The glue-calling will spill the values again anyway. This should prevent a lot of load/spill junk in the output. It is also necessary to be able to have unique vecs be immediate values (take must know the actual address to be able to duplicate).
2011-08-26Revert "Use typestate constraints for trans_be"Tim Chevalier-11/+4
This reverts commit 1b60bba141c54f374d3378aa229c756d4a8f7f3d. (Need a snapshot first)
2011-08-26Use typestate constraints for trans_beTim Chevalier-4/+11
trans_be now has a precondition that its expression argument is a call expr. Obviously this code may be going away soon, but I wanted to exercise typestate somehow and this was an easy one :-)
2011-08-26Let typestate constraints mention pattern-bound varsTim Chevalier-5/+10
2011-08-25Support unchecked blocksTim Chevalier-1/+6
This patch supports the syntax unchecked { ... } to disable purity checking within a block. Presumably it will only be used within a declared "pure fn". However, there is no checking that it doesn't occur elsewhere, and it would be harmless for it to do so. I went with Lindsey's suggestion for the syntax, but it's subject to change. This allows you to write code that uses predicates that call arbitrary Rust functions, but you must declare your intentions by wrapping it in an unchecked { ... } block. The test case run-pass/unchecked-predicates.rs demonstrates how to do that.
2011-08-25Allow pure fns to have any return typeTim Chevalier-13/+13
2011-08-25rt: Remember the number of captured type descriptors for objects in the type ↵Patrick Walton-1/+4
descriptor crate cache
2011-08-25Move ast::pat_id_map to ast::utilBrian Anderson-3/+3
2011-08-25rustc: Add an extra flag to object tydescs so that shapes know how to find ↵Patrick Walton-62/+88
the captured subtydescs
2011-08-24Revert "Back out copy-glue"Marijn Haverbeke-5/+107
This reverts commit 629ee94a0b360e2df1a1bbf7bf61ef346adf36ad.
2011-08-24Use memmove to load istr literals. Issue #855Brian Anderson-11/+4
2011-08-24Back out copy-glueMarijn Haverbeke-107/+5
This wasn't a good idea after all.
2011-08-24Use a single builder object throughoutMarijn Haverbeke-113/+271
This seems to be faster than creating separate ones for each block context.
2011-08-24Move to a more lightweight builder systemMarijn Haverbeke-675/+1146
You now do bld::Ret(bcx, someval) where you used to say bcx.build.Ret(someval) Two fewer boxes are allocated for each block context, and build calls no longer go through a vtable.
2011-08-24Ensure values created in an alt guard are cleaned up properlyMarijn Haverbeke-2/+3
2011-08-24Optimize += [x] into a simple push operationMarijn Haverbeke-14/+53
This is a preparation for making vectors always-on-the-heap again, which would cause way too much malloc traffic for this idiom. I will add an efficient std::vec::push in the future, and migrate += [x] to that instead. Reduces compiler code size by 3%
2011-08-24Check for is_terminated after translating a blockMarijn Haverbeke-1/+1
Closes #861
2011-08-23Zero locals with initializers that may break or terminate. Closes #787Brian Anderson-1/+41
2011-08-23Add kind-checking for assign-op, copy, ret, be, fail exprs. Fix caught ↵Graydon Hoare-0/+14
kinding-violations in rustc and libstd.
2011-08-23Recheck the while loop contition after continuing. Closes #825Brian Anderson-4/+4
2011-08-22Teach rustc to append istrs. Issue #855Brian Anderson-7/+23
2011-08-22Teach rustc to add istrs. Issue #855Brian Anderson-0/+10
2011-08-22Encode the istr shape correctly. Issue #855Brian Anderson-2/+7
2011-08-22Fix ivec self-append. Closes #816Brian Anderson-0/+6
2011-08-22Create correct drop glue for istrs. Issue #855Brian Anderson-0/+4
2011-08-22Translate istr literals. Issue #855Brian Anderson-55/+24
2011-08-22Extract trans_ivec::alloc_with_heap from trans_ivec::trans_ivecBrian Anderson-9/+32
Need this for building istrs
2011-08-22Move trans::ivec to middle::trans_ivecBrian Anderson-691/+704
2011-08-22Move trans_ivec into the ivec moduleBrian Anderson-95/+93
2011-08-22Move functions from syntax::ast to syntax::ast_utilBrian Anderson-61/+88
This leaves syntax::ast just defining the AST, which strikes me as somewhat nicer
2011-08-22Implement pattern guardsMarijn Haverbeke-26/+62
The syntax is alt x { mypat where mycond { ... } } The condition may refer to any of the variables bound by the pattern. When a guard fails, pattern-matching continues with the next pattern. Closes #857
2011-08-22Fix bug introduced by 1a45a84e73a92e8aMarijn Haverbeke-0/+1
2011-08-22Start using copy glue to copy bits that may contain ivecsMarijn Haverbeke-26/+43
This is not currently necessary, but will be, when I land the new ivec representation.
2011-08-22Write a type_structurally_contains, use it to rewrite has_dynamic_sizeMarijn Haverbeke-35/+29
(I'll be using this for type-needs-copy-glue in the near future.)
2011-08-22Remove silly restriction on passing type params by aliasMarijn Haverbeke-12/+2
Since they are now passed by pointer, this is no longer a problem
2011-08-22Replace &ty::t with ty::t throughout the compilerMarijn Haverbeke-143/+143
Type handles are uints, passing them by reference only causes unnecessary spilling.
2011-08-22Do not check for self-assign unless dest is initializedMarijn Haverbeke-93/+92
Also, give copy_val and move_val a more sane return type.
2011-08-22Write call_copy_glueMarijn Haverbeke-1/+40
2011-08-22Add skeleton of copy glue that actually copiesMarijn Haverbeke-12/+76
2011-08-22Rename copy_glue back to take_glueMarijn Haverbeke-25/+25
2011-08-22Drop arguments on the caller side, not the calleeMarijn Haverbeke-129/+109
This makes it easier for the caller to optimize the take/drop away for temporary values, and opens up new possibilities for alias handling. Breaks tail calls.
2011-08-22Pass structural types by pointer, not by valueMarijn Haverbeke-42/+36
If we lose tail calls, this is possible. It simplifies things a lot. Direct motivation: We want ivecs with pointers pointing into themselves. When copying those, the pointers have to be adjusted. It is impossible to this when copying them with Load/Store.
2011-08-20rustc: Introduce ABI versioning so we can change value representations ↵Patrick Walton-6/+18
without breaking the compiler
2011-08-20ReformatBrian Anderson-2903/+2830
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-19rustc: Unconditionally zero out all GC-relevant types for nowPatrick Walton-0/+5
2011-08-19Fix polymorphic iterators. Closes #829.Michael Sullivan-3/+12
2011-08-19Use move semantics when returning a local varMarijn Haverbeke-1/+13
(Since the variable won't be used after return anyway.)
2011-08-19Temporary work-around for issue #843Marijn Haverbeke-2/+3
2011-08-19Revert "Disable warnings for unused function arguments. Temporary hack."Tim Chevalier-6/+1
This reverts commit 1ec2211a98aac3f4444301f44eba608d2df818c1.
2011-08-19Disable warnings for unused function arguments. Temporary hack.Tim Chevalier-1/+6