about summary refs log tree commit diff
path: root/src/comp
AgeCommit message (Collapse)AuthorLines
2011-08-26rt: Allow closures to be loggedPatrick Walton-2/+6
2011-08-26Bugfix. `--pretty typed` requires expansion. Closes #691.Paul Stansifer-21/+14
2011-08-26Fix invalid reads of cstrs in transBrian Anderson-5/+6
2011-08-26Revert "Use cstrcache in C_str, C_cstr, C_shape."Brian Anderson-14/+7
This reverts commit d5173b1f2cc174d53272be0d14a8290c05b8670a.
2011-08-26Revert "Add rustc::middle::cstrcache for getting c string bufs safely"Brian Anderson-30/+0
This reverts commit 4e136d1fd9bd5536d441c062d41e7b71b375a942.
2011-08-26Use cstrcache in C_str, C_cstr, C_shape.Brian Anderson-7/+14
This fixes up the current leaks.
2011-08-26Add rustc::middle::cstrcache for getting c string bufs safelyBrian Anderson-0/+30
We continue to leak string buffers in trans so this creates a way to get c string buffers from strings while guaranteeing that they are not freed before use. Hopefully this can be made efficient in the istr regime.
2011-08-26Revert "Revert "Use typestate constraints for trans_be""Tim Chevalier-6/+13
This reverts commit b0db13956f4f106c4bf5a9210c7df439b34506a4. (Should work now that we have a new snapshot)
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-13/+6
This reverts commit 1b60bba141c54f374d3378aa229c756d4a8f7f3d. (Need a snapshot first)
2011-08-26Use typestate constraints for trans_beTim Chevalier-6/+13
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-25Remove remaining use of 'pred' and make 'pred' a non-reserved word. Huzzah\!Tim Chevalier-6/+0
2011-08-25Remove typestate workaround that's no longer necessaryTim Chevalier-4/+1
2011-08-25Support unchecked blocksTim Chevalier-19/+55
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-25Change "pred" to "pure fn" within the compiler.Tim Chevalier-2/+2
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-5/+5
2011-08-25rustc: Add an extra flag to object tydescs so that shapes know how to find ↵Patrick Walton-64/+91
the captured subtydescs
2011-08-24hmm, this should have been in the last commit. Oops.Tim Chevalier-0/+1
2011-08-24Change "pred" to "pure fn" (but still accept "pred")Tim Chevalier-7/+11
This is part 1 of changing the "pred" keyword to "pure fn". Right now, the compiler accepts both "pred" and "pure fn".
2011-08-24Revert "Back out copy-glue"Marijn Haverbeke-6/+108
This reverts commit 629ee94a0b360e2df1a1bbf7bf61ef346adf36ad.
2011-08-24Use memmove to load istr literals. Issue #855Brian Anderson-11/+4
2011-08-24Back out copy-glueMarijn Haverbeke-108/+6
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-1194/+1147
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/+57
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-23Resolve a number of FIXMEsBrian Anderson-2/+2
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-6/+20
kinding-violations in rustc and libstd.
2011-08-23Recheck the while loop contition after continuing. Closes #825Brian Anderson-4/+4
2011-08-23Fix pretty-printing of istr literals. Issue #855Brian Anderson-2/+13
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/+705
2011-08-22Move trans_ivec into the ivec moduleBrian Anderson-95/+93
2011-08-22Move functions from syntax::ast to syntax::ast_utilBrian Anderson-314/+358
This leaves syntax::ast just defining the AST, which strikes me as somewhat nicer
2011-08-22Remove ast::spawn_domBrian Anderson-2/+0
2011-08-22Implement pattern guardsMarijn Haverbeke-29/+80
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.)