about summary refs log tree commit diff
path: root/src/comp
AgeCommit message (Collapse)AuthorLines
2011-09-19Register tuple cleanups after the tuple is builtBrian Anderson-1/+3
Issue #936
2011-09-19Break fold's circular reference during unwindingBrian Anderson-9/+7
This converts the AST fold into a resource that breaks it's own circular reference (just a temporary workaround until GC), so that failure during fold will unwind correctly. Issue #936
2011-09-19Build records in two phases to avoid cleanups on partial recordsBrian Anderson-5/+42
2011-09-19Don't register record cleanups until the record is builtBrian Anderson-1/+1
2011-09-18Stop creating function pairs for static functionsMarijn Haverbeke-86/+43
These are now called directly. When taking their value, a null pointer is added to create a pair.
2011-09-17Add a precondition to GEP_tup_likeTim Chevalier-4/+73
2011-09-17Add a type_is_tup_like predicate that takes a block ctxt, and make some fns pureTim Chevalier-15/+18
2011-09-17In trans, replace another impossible case with a preconditionTim Chevalier-11/+8
2011-09-16Make move-mode arguments unwind correctly. Closes #939Brian Anderson-31/+56
2011-09-16Dead code elimTim Chevalier-14/+0
2011-09-16Add a constraint on trans::type_of_fn_from_tyTim Chevalier-23/+49
And change callers appropriately.
2011-09-16Add a returns_non_ty_var predicateTim Chevalier-0/+4
which just calls non_ty_var on the return type of t, assuming t is a function type.
2011-09-16Make ty_fn_ret pure and get rid of a duplicate functionTim Chevalier-16/+14
2011-09-16Work around an apparent compiler bug to make my patch runMarijn Haverbeke-5/+6
Without this, it would fail when optimization is turned on. The result of the Load(bcx, llclosure) call would end up in llenv in a corrupted form.
2011-09-16Saner approach to lvalues and callable values in transMarijn Haverbeke-194/+217
LValues no longer carry information about generics and objs, instead there's an extended form of lvalue, lval_maybe_callee, only used by call and bind, which holds this info. This makes it possible to take the value of a method and get a working closure, and will (with some more work) allow us to call statically known functions without loading from their pair. Closes #435 Closes #758
2011-09-16Add non_ty_var precondition for type_of_fn, plus minor cleanupTim Chevalier-10/+17
2011-09-16Revert "Saner approach to lvalues and callable values in trans"Marijn Haverbeke-217/+194
This reverts commit 66153436c9070386786c8a38cde199b5d3e71289.
2011-09-16Require body of else-less if expressions to be a value-less blockMarijn Haverbeke-12/+16
For consistency with other constructs that could not possibly return a value (say, loops).
2011-09-16Saner approach to lvalues and callable values in transMarijn Haverbeke-194/+217
LValues no longer carry information about generics and objs, instead there's an extended form of lvalue, lval_maybe_callee, only used by call and bind, which holds this info. This makes it possible to take the value of a method and get a working closure, and will (with some more work) allow us to call statically known functions without loading from their pair. Closes #435 Closes #758
2011-09-16Move expr_uniq case in trans to a saner placeMarijn Haverbeke-12/+4
Note that unique pointers are still broken in more ways than I can count.
2011-09-16Remove autoderef for callsMarijn Haverbeke-24/+12
We were only using it in a single place, and there for no discernable reason (probably as part of the bare-fn-vals-are-not-copyable plan). It seems more surprising than useful.
2011-09-16Remove unused method_ty field from lval_resultMarijn Haverbeke-10/+5
2011-09-16Clean up (and optimize) root-mutability analysis in alias.rsMarijn Haverbeke-70/+64
2011-09-16Change convention for specifying referenced argumentMarijn Haverbeke-20/+32
It is now 1-based, rather than 0 based. (Seems more natural, and allows 0 to be used to refer to self and maybe to closure.) Also allows non-referenced args to be implicitly copied again. Issue #918
2011-09-15Actually call unreachable() in impossible case in type_of_innerTim Chevalier-3/+5
2011-09-15Added non_ty_var precondition to trans::type_of_innerTim Chevalier-57/+109
This allows us to legitimately call unreachable() in the ty_var case.
2011-09-15Add parens, as needed, around else-if conditions.Jesse Ruderman-1/+1
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-15Added more predicates in transTim Chevalier-2/+16
Added the non_ty_var predicate (soon to be used) Added a check in get_res_dtor (will be necessary for a future change to type_of_fn) Removed a gratuitous ret
2011-09-15Change a few span_fatals to span_errTim Chevalier-5/+5
2011-09-15Update README slightly.Graydon Hoare-2/+3
2011-09-15Prevent binary expressions from parsing when lhs is non-value blockMarijn Haverbeke-0/+1
2011-09-15Generalize expression roots in alias analysisMarijn Haverbeke-35/+40
This allows calls-returning-a-reference to count as expression roots, making it possible to return the result of such a call by reference. Issue #918
2011-09-15Require the parameter that will be referenced to be notedMarijn Haverbeke-38/+74
Issue #918
2011-09-15Overhaul alias-checking of blocksMarijn Haverbeke-34/+27
The set of active bindings has to be updated as by-reference locals are encountered. Issue #918
2011-09-15Make storing returned references in a by-reference local workMarijn Haverbeke-39/+47
fn f(a: {x: str}) -> &str { ret a.x; } fn main() { let x = {x: "hi"}; let &y = f(x); // Look ma, no copy! log_err y; } Issue #918.
2011-09-15Forbid assignment to by-reference bindingsMarijn Haverbeke-21/+25
Issue #918
2011-09-15Make trans understand by-ref bindingsMarijn Haverbeke-8/+19
Issue #918
2011-09-15Implement basic checking of by-reference bindingsMarijn Haverbeke-3/+57
Issue #918
2011-09-15Move local numbering into ast_map.rsMarijn Haverbeke-48/+67
This further simplifies the alias pass, which is sorely needed.
2011-09-15Add representation for by-ref let bindingsMarijn Haverbeke-19/+31
Issue #918
2011-09-15Ensure parens are wrapped around composite exprs in call/index/field posMarijn Haverbeke-5/+10
This is needed to fix the second example in issue #919
2011-09-15More thorough check for (.. 10).x in pretty-printerMarijn Haverbeke-5/+21
Closes #919
2011-09-15Also handle fail and put in print_maybe_parens_discrimMarijn Haverbeke-2/+5
Closes #920
2011-09-15Remove maybe_protect_block kludge from pretty-printerMarijn Haverbeke-86/+0
It is no longer needed.
2011-09-15Introduce new semicolon rulesMarijn Haverbeke-71/+44
- Loop bodies and resource constructors aren't allowed to have trailing expressions anymore. - An expression that ends* in a block without trailing expression can can not be called, indexed, or subscripted. - Only expression-statements that end* in a block without trailing expression can omit their semicolon. *) 'Ending in a trailing expression' is defined as being a block or construct-ending-in-a-block (if, alt) that either ends in an expression itself, or ends in another block-like expression that has a trailing expression (by these same rules).
2011-09-15Insert omitted semicolons for statementsMarijn Haverbeke-17/+14
2011-09-14Revert "Try a little harder to avoid creating new landing pads"Brian Anderson-11/+10
This reverts commit b8e31ac46917edcf5922f0b191c5e6c4505830d2. Conflicts: src/comp/middle/trans.rs
2011-09-14Add syntax and representation for return-by-mutably-rooted-refMarijn Haverbeke-34/+55
This will be used in the near future to decide what can safely be done with the returned reference. Issue #918
2011-09-14Prevent memory errors when returning references to temp args.Marijn Haverbeke-14/+18
Issue #918