Lines Matching refs:type

33 static struct expr *expr_lookup(enum expr_type type, void *l, void *r)  in expr_lookup()  argument
38 hash = hash_32((unsigned int)type ^ hash_ptr(l) ^ hash_ptr(r)); in expr_lookup()
41 if (e->type == type && e->left._initdata == l && in expr_lookup()
47 e->type = type; in expr_lookup()
62 struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) in expr_alloc_one() argument
64 return expr_lookup(type, ce, NULL); in expr_alloc_one()
67 struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) in expr_alloc_two() argument
69 return expr_lookup(type, e1, e2); in expr_alloc_two()
72 struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) in expr_alloc_comp() argument
74 return expr_lookup(type, s1, s2); in expr_alloc_comp()
101 static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2) in __expr_eliminate_eq() argument
107 if ((*ep1)->type == type) { in __expr_eliminate_eq()
110 __expr_eliminate_eq(type, &l, ep2); in __expr_eliminate_eq()
111 __expr_eliminate_eq(type, &r, ep2); in __expr_eliminate_eq()
112 *ep1 = expr_alloc_two(type, l, r); in __expr_eliminate_eq()
115 if ((*ep2)->type == type) { in __expr_eliminate_eq()
118 __expr_eliminate_eq(type, ep1, &l); in __expr_eliminate_eq()
119 __expr_eliminate_eq(type, ep1, &r); in __expr_eliminate_eq()
120 *ep2 = expr_alloc_two(type, l, r); in __expr_eliminate_eq()
126 if ((*ep1)->type == E_SYMBOL && (*ep2)->type == E_SYMBOL && in __expr_eliminate_eq()
136 switch (type) { in __expr_eliminate_eq()
183 switch ((*ep1)->type) { in expr_eliminate_eq()
186 __expr_eliminate_eq((*ep1)->type, ep1, ep2); in expr_eliminate_eq()
190 if ((*ep1)->type != (*ep2)->type) switch ((*ep2)->type) { in expr_eliminate_eq()
193 __expr_eliminate_eq((*ep2)->type, ep1, ep2); in expr_eliminate_eq()
219 if (e1->type != e2->type) in expr_eq()
221 switch (e1->type) { in expr_eq()
237 res = (e1->type == E_SYMBOL && e2->type == E_SYMBOL && in expr_eq()
271 if (e) switch (e->type) { in expr_eliminate_yn()
275 if (l->type == E_SYMBOL) { in expr_eliminate_yn()
281 if (r->type == E_SYMBOL) { in expr_eliminate_yn()
291 if (l->type == E_SYMBOL) { in expr_eliminate_yn()
297 if (r->type == E_SYMBOL) { in expr_eliminate_yn()
320 if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) in expr_join_or()
322 if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) in expr_join_or()
324 if (e1->type == E_NOT) { in expr_join_or()
326 if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) in expr_join_or()
331 if (e2->type == E_NOT) { in expr_join_or()
332 if (e2->left.expr->type != E_SYMBOL) in expr_join_or()
339 if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) in expr_join_or()
341 if (sym1->type == S_TRISTATE) { in expr_join_or()
342 if (e1->type == E_EQUAL && e2->type == E_EQUAL && in expr_join_or()
348 if (e1->type == E_EQUAL && e2->type == E_EQUAL && in expr_join_or()
354 if (e1->type == E_EQUAL && e2->type == E_EQUAL && in expr_join_or()
361 if (sym1->type == S_BOOLEAN) { in expr_join_or()
363 if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) || in expr_join_or()
364 (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL)) in expr_join_or()
385 if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) in expr_join_and()
387 if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) in expr_join_and()
389 if (e1->type == E_NOT) { in expr_join_and()
391 if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) in expr_join_and()
396 if (e2->type == E_NOT) { in expr_join_and()
397 if (e2->left.expr->type != E_SYMBOL) in expr_join_and()
404 if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) in expr_join_and()
407 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
408 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
412 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
413 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
417 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
418 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
422 if (sym1->type == S_TRISTATE) { in expr_join_and()
423 if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) { in expr_join_and()
430 if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) { in expr_join_and()
437 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && in expr_join_and()
443 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && in expr_join_and()
449 if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && in expr_join_and()
455 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
456 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
457 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
458 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
479 static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2) in expr_eliminate_dups1() argument
485 if ((*ep1)->type == type) { in expr_eliminate_dups1()
488 expr_eliminate_dups1(type, &l, ep2); in expr_eliminate_dups1()
489 expr_eliminate_dups1(type, &r, ep2); in expr_eliminate_dups1()
490 *ep1 = expr_alloc_two(type, l, r); in expr_eliminate_dups1()
493 if ((*ep2)->type == type) { in expr_eliminate_dups1()
496 expr_eliminate_dups1(type, ep1, &l); in expr_eliminate_dups1()
497 expr_eliminate_dups1(type, ep1, &r); in expr_eliminate_dups1()
498 *ep2 = expr_alloc_two(type, l, r); in expr_eliminate_dups1()
504 switch (type) { in expr_eliminate_dups1()
548 switch (e->type) { in expr_eliminate_dups()
552 expr_eliminate_dups1(e->type, &l, &r); in expr_eliminate_dups()
553 e = expr_alloc_two(e->type, l, r); in expr_eliminate_dups()
597 switch (e->type) { in expr_transform()
607 e = expr_alloc_two(e->type, in expr_transform()
612 switch (e->type) { in expr_transform()
614 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
634 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
654 switch (e->left.expr->type) { in expr_transform()
662 e = expr_alloc_comp(e->left.expr->type == E_EQUAL ? E_UNEQUAL : E_EQUAL, in expr_transform()
669 e = expr_alloc_comp(e->left.expr->type == E_LEQ ? E_GTH : E_LTH, in expr_transform()
676 e = expr_alloc_comp(e->left.expr->type == E_LTH ? E_GEQ : E_LEQ, in expr_transform()
718 switch (dep->type) { in expr_contains_symbol()
746 switch (dep->type) { in expr_depends_symbol()
784 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
790 if (type == E_UNEQUAL) in expr_trans_compare()
794 switch (e->type) { in expr_trans_compare()
802 if (type == E_UNEQUAL) in expr_trans_compare()
812 if (type == E_UNEQUAL) in expr_trans_compare()
816 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
823 if (type == E_EQUAL) { in expr_trans_compare()
840 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
860 enum symbol_type type, in expr_parse_string() argument
867 switch (type) { in expr_parse_string()
899 switch (e->type) { in __expr_calc_value()
922 printf("expr_calc_value: %d?\n", e->type); in __expr_calc_value()
931 if (e->left.sym->type != S_STRING || e->right.sym->type != S_STRING) { in __expr_calc_value()
932 k1 = expr_parse_string(str1, e->left.sym->type, &lval); in __expr_calc_value()
933 k2 = expr_parse_string(str2, e->right.sym->type, &rval); in __expr_calc_value()
943 switch(e->type) { in __expr_calc_value()
957 printf("expr_calc_value: relation %d?\n", e->type); in __expr_calc_value()
1031 if (expr_compare_type(prevtoken, e->type) > 0) in expr_print()
1033 switch (e->type) { in expr_print()
1058 fn(data, NULL, e->type == E_LEQ ? "<=" : "<"); in expr_print()
1067 fn(data, NULL, e->type == E_GEQ ? ">=" : ">"); in expr_print()
1098 sprintf(buf, "<unknown type %d>", e->type); in expr_print()
1103 if (expr_compare_type(prevtoken, e->type) > 0) in expr_print()
1143 if (sym && sym->type != S_UNKNOWN) in expr_print_gstr_helper()
1161 if (e->type == E_OR) { in expr_print_revdep()