aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-12-31 13:13:52 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-31 13:13:52 -0800
commit3199700ab667063556470bdd45bfce0905465974 (patch)
treebf845cddf803ca13a3bb7ee2da02098369de7e3d /parse.h
parent[PATCH] fix sparse warnings (diff)
downloadsparse-3199700ab667063556470bdd45bfce0905465974.tar.gz
sparse-3199700ab667063556470bdd45bfce0905465974.tar.bz2
sparse-3199700ab667063556470bdd45bfce0905465974.zip
Make local declarations be statements of their own
This removes the list of symbols for block statements, and instead makes a declaration be a statement of its own. This is necessary to correctly handle the case of mixed statements and declarations correctly, since the order of declarations and statements is meaningful. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'parse.h')
-rw-r--r--parse.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.h b/parse.h
index bc4781f..2f3a3fe 100644
--- a/parse.h
+++ b/parse.h
@@ -13,6 +13,7 @@
enum statement_type {
STMT_NONE,
+ STMT_DECLARATION,
STMT_EXPRESSION,
STMT_COMPOUND,
STMT_IF,
@@ -31,6 +32,9 @@ struct statement {
enum statement_type type;
struct position pos;
union {
+ struct /* declaration */ {
+ struct symbol_list *declaration;
+ };
struct /* label_arg */ {
struct symbol *label;
struct statement *label_statement;
@@ -46,7 +50,6 @@ struct statement {
struct statement *if_false;
};
struct /* compound_struct */ {
- struct symbol_list *syms;
struct statement_list *stmts;
struct symbol *ret;
};