Lines Matching defs:ep2
96 * Walks the two expression trees given in 'ep1' and 'ep2'. Any node that does
101 static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2)
110 __expr_eliminate_eq(type, &l, ep2);
111 __expr_eliminate_eq(type, &r, ep2);
115 if ((*ep2)->type == type) {
116 l = (*ep2)->left.expr;
117 r = (*ep2)->right.expr;
120 *ep2 = expr_alloc_two(type, l, r);
124 /* *ep1 and *ep2 are leaves. Compare them. */
126 if ((*ep1)->type == E_SYMBOL && (*ep2)->type == E_SYMBOL &&
127 (*ep1)->left.sym == (*ep2)->left.sym &&
130 if (!expr_eq(*ep1, *ep2))
133 /* *ep1 and *ep2 are equal leaves. Prepare them for elimination. */
139 *ep2 = expr_alloc_symbol(&symbol_no);
143 *ep2 = expr_alloc_symbol(&symbol_yes);
151 * Rewrites the expressions 'ep1' and 'ep2' to remove operands common to both.
155 * ep2: A && B && C -> ep2: C
158 * ep2: A || B || C -> ep2: C
161 * ep2: (BAR && B) && A -> ep2: BAR
164 * ep2: (C || B) && A -> ep2: y
179 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
181 if (!*ep1 || !*ep2)
186 __expr_eliminate_eq((*ep1)->type, ep1, ep2);
190 if ((*ep1)->type != (*ep2)->type) switch ((*ep2)->type) {
193 __expr_eliminate_eq((*ep2)->type, ep1, ep2);
198 *ep2 = expr_eliminate_yn(*ep2);
475 * Walks the two expression trees given in 'ep1' and 'ep2'. Any node that does
479 static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2)
488 expr_eliminate_dups1(type, &l, ep2);
489 expr_eliminate_dups1(type, &r, ep2);
493 if ((*ep2)->type == type) {
494 l = (*ep2)->left.expr;
495 r = (*ep2)->right.expr;
498 *ep2 = expr_alloc_two(type, l, r);
502 /* *ep1 and *ep2 are leaves. Compare and process them. */
506 tmp = expr_join_or(*ep1, *ep2);
509 *ep2 = tmp;
514 tmp = expr_join_and(*ep1, *ep2);
517 *ep2 = tmp;