Drop arguments on the caller side, not the callee

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.
This commit is contained in:
Marijn Haverbeke 2011-08-19 14:34:45 +02:00
parent 35c962e9a1
commit b24f978011
8 changed files with 125 additions and 147 deletions

View file

@ -1081,7 +1081,8 @@ fn parse_dot_or_call_expr_with(p: &parser, e: @ast::expr) -> @ast::expr {
parse_seq(token::LPAREN, token::RPAREN,
some(token::COMMA), parse_expr, p);
hi = es.span.hi;
e = mk_expr(p, lo, hi, ast::expr_call(e, es.node));
let nd = ast::expr_call(e, es.node);
e = mk_expr(p, lo, hi, nd);
}
}
token::LBRACKET. {