aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-04-04 18:45:37 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:13 -0700
commit05698d1e5a47ce5a9d9163e57731b16d4d3af9fb (patch)
tree75113cbc005589ab9216f9dabbcfb637c5f47355 /expression.h
parentClean up and factor out offset add from member dereference. (diff)
downloadsparse-05698d1e5a47ce5a9d9163e57731b16d4d3af9fb.tar.gz
sparse-05698d1e5a47ce5a9d9163e57731b16d4d3af9fb.tar.bz2
sparse-05698d1e5a47ce5a9d9163e57731b16d4d3af9fb.zip
Evaluate logical expressions, and short-circuit it.
Make the pre-processor use the expression evaluator, so that it actually gets all the signed/unsigned comparisons right etc. Make logical expressions an expression type of their own. They have some very special behaviour both type-wise and evaluation-wise (the short-circuiting thing).
Diffstat (limited to 'expression.h')
-rw-r--r--expression.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/expression.h b/expression.h
index 4588f14..36cd8b4 100644
--- a/expression.h
+++ b/expression.h
@@ -16,6 +16,7 @@ enum expression_type {
EXPR_SYMBOL,
EXPR_BINOP,
EXPR_ASSIGNMENT,
+ EXPR_LOGICAL,
EXPR_DEREF,
EXPR_PREOP,
EXPR_POSTOP,
@@ -56,7 +57,7 @@ struct expression {
// EXPR_STATEMENT
struct statement *statement;
- // EXPR_BINOP, EXPR_COMMA, EXPR_COMPARE and EXPR_ASSIGNMENT
+ // EXPR_BINOP, EXPR_COMMA, EXPR_COMPARE, EXPR_LOGICAL and EXPR_ASSIGNMENT
struct binop_arg {
struct expression *left, *right;
};