Teach trans to allocate, initialize and load from local variables.

This commit is contained in:
Graydon Hoare 2010-10-19 14:54:10 -07:00
parent 10d628dbd0
commit b8cca0971f
6 changed files with 174 additions and 18 deletions

View file

@ -78,7 +78,7 @@ type local = rec(option[@ty] ty,
type decl = spanned[decl_];
tag decl_ {
decl_local(local);
decl_local(@local);
decl_item(@item);
}

View file

@ -629,7 +629,7 @@ io fn parse_let(parser p) -> @ast.decl {
init = init,
id = p.next_def_id());
ret @spanned(lo, hi, ast.decl_local(local));
ret @spanned(lo, hi, ast.decl_local(@local));
}
io fn parse_auto(parser p) -> @ast.decl {
@ -648,7 +648,7 @@ io fn parse_auto(parser p) -> @ast.decl {
init = init,
id = p.next_def_id());
ret @spanned(lo, hi, ast.decl_local(local));
ret @spanned(lo, hi, ast.decl_local(@local));
}
io fn parse_stmt(parser p) -> @ast.stmt {