aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test-parsing.c
diff options
authorLinus Torvalds <torvalds@home.transmeta.com>2003-03-25 20:09:14 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 20:59:47 -0700
commit6093c190f23c24fbe55eae0fd233d14e6dfd1643 (patch)
tree5e859ac76e839e9cf2da18ded5fbe58fd68bb25a /test-parsing.c
parent38795344d7b03fc340b5cabb0a38e22d327836d9 (diff)
downloadsparse-dev-6093c190f23c24fbe55eae0fd233d14e6dfd1643.tar.gz
Add tree evaluation to a few more statement types (iterators,
switch and case-statements). Handle varying functions.
Diffstat (limited to 'test-parsing.c')
-rw-r--r--test-parsing.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test-parsing.c b/test-parsing.c
index bc083979..b5ecb501 100644
--- a/test-parsing.c
+++ b/test-parsing.c
@@ -44,6 +44,22 @@ static void simplify_statement(struct statement *stmt, struct symbol *fn)
simplify_statement(stmt->if_true, fn);
simplify_statement(stmt->if_false, fn);
return;
+ case STMT_ITERATOR:
+ evaluate_expression(stmt->iterator_pre_condition);
+ evaluate_expression(stmt->iterator_post_condition);
+ simplify_statement(stmt->iterator_pre_statement, fn);
+ simplify_statement(stmt->iterator_statement, fn);
+ simplify_statement(stmt->iterator_post_statement, fn);
+ return;
+ case STMT_SWITCH:
+ evaluate_expression(stmt->switch_expression);
+ simplify_statement(stmt->switch_statement, fn);
+ return;
+ case STMT_CASE:
+ evaluate_expression(stmt->case_expression);
+ evaluate_expression(stmt->case_to);
+ simplify_statement(stmt->case_statement, fn);
+ return;
}
}