Lines Matching refs:expr

23 static int is_bool(struct expression *expr)  in is_bool()  argument
27 type = get_type(expr); in is_bool()
35 static int is_bool_from_context(struct expression *expr) in is_bool_from_context() argument
39 if (!get_implied_max(expr, &sval) || sval.uvalue > 1) in is_bool_from_context()
41 if (!get_implied_min(expr, &sval) || sval.value < 0) in is_bool_from_context()
46 static int is_bool_op(struct expression *expr) in is_bool_op() argument
48 expr = strip_expr(expr); in is_bool_op()
50 if (expr->type == EXPR_PREOP && expr->op == '!') in is_bool_op()
52 if (expr->type == EXPR_COMPARE) in is_bool_op()
54 if (expr->type == EXPR_LOGICAL) in is_bool_op()
56 return is_bool(expr); in is_bool_op()
59 static void match_condition(struct expression *expr) in match_condition() argument
63 if (expr->type == EXPR_COMPARE) { in match_condition()
64 if (expr->left->type == EXPR_COMPARE || expr->right->type == EXPR_COMPARE) in match_condition()
66 if (expr->left->type == EXPR_PREOP && expr->left->op == '!') { in match_condition()
67 if (expr->left->unop->type == EXPR_PREOP && expr->left->unop->op == '!') in match_condition()
69 if (expr->right->op == '!') in match_condition()
71 if (is_bool(expr->right)) in match_condition()
73 if (is_bool(expr->left->unop)) in match_condition()
75 if (is_bool_from_context(expr->left->unop)) in match_condition()
81 if (expr->type == EXPR_BINOP) { in match_condition()
82 if (expr->left->type == EXPR_COMPARE || expr->right->type == EXPR_COMPARE) in match_condition()
91 if (expr->type == EXPR_BINOP && expr->op == '&') { in match_condition()
94 if (is_bool_op(expr->left)) in match_condition()
96 if (is_bool_op(expr->right)) in match_condition()
103 static void match_binop(struct expression *expr) in match_binop() argument
105 if (expr->op != '&') in match_binop()
107 if (expr->left->op == '!') in match_binop()
111 static void match_mask(struct expression *expr) in match_mask() argument
113 if (expr->op != '&') in match_mask()
115 if (expr->right->type != EXPR_BINOP) in match_mask()
117 if (expr->right->op != SPECIAL_RIGHTSHIFT) in match_mask()
123 static void match_mask_compare(struct expression *expr) in match_mask_compare() argument
125 if (expr->op != '&') in match_mask_compare()
127 if (expr->right->type != EXPR_COMPARE) in match_mask_compare()
133 static void match_subtract_shift(struct expression *expr) in match_subtract_shift() argument
135 if (expr->op != SPECIAL_LEFTSHIFT) in match_subtract_shift()
137 if (expr->right->type != EXPR_BINOP) in match_subtract_shift()
139 if (expr->right->op != '-') in match_subtract_shift()