new: smatch_scripts/test_kernel.sh
[smatch.git] / smatch_expressions.c
blob00525651bb9c463cef9253807217aa100b922053
1 #include "smatch.h"
3 static struct position pos;
5 struct expression *zero_expr()
7 static struct expression *zero;
9 if (zero)
10 return zero;
12 zero = alloc_expression(pos, EXPR_VALUE);
13 zero->value = 0;
14 return zero;
17 struct expression *value_expr(long long val)
19 struct expression *expr;
21 if (!val)
22 return zero_expr();
24 expr = alloc_expression(pos, EXPR_VALUE);
25 expr->value = val;
26 return expr;