Make ret and fail stmts have 0 out-edges, Closes #250.

This commit is contained in:
Graydon Hoare 2011-03-05 20:05:02 +00:00
parent 94b681afe4
commit d97c800e31
4 changed files with 9 additions and 7 deletions

View file

@ -865,6 +865,11 @@ let rec build_flow_graph_for_stmt
| Ast.STMT_block b ->
blk predecessors b
| Ast.STMT_fail
| Ast.STMT_ret _ ->
connect predecessors [s.id];
[]
| _ ->
connect predecessors [s.id];
[s.id]

View file

@ -665,12 +665,9 @@ impure fn next_token(reader rdr) -> token.token {
case ('%') {
ret binop(rdr, token.PERCENT);
}
}
log "lexer stopping at ";
log c;
ret token.EOF;
fail;
}

View file

@ -701,7 +701,7 @@ fn fold_expr[ENV](&ENV env, ast_fold[ENV] fld, &@expr e) -> @expr {
}
ret e;
fail;
}
@ -724,7 +724,7 @@ fn fold_stmt[ENV](&ENV env, ast_fold[ENV] fld, &@stmt s) -> @stmt {
ret fld.fold_stmt_expr(env_, s.span, ee);
}
}
ret s;
fail;
}
fn fold_block[ENV](&ENV env, ast_fold[ENV] fld, &block blk) -> block {

View file

@ -373,7 +373,7 @@ fn fold_ty(ty_fold fld, @t ty) -> @t {
case (ty_param(_)) { ret fld.fold_simple_ty(ty); }
}
ret ty;
fail;
}
// Type utilities