Lines Matching defs:tn
416 check_case_label_enum(const tnode_t *tn, const control_statement *cs)
420 if (!(tn->tn_type->t_is_enum || cs->c_switch_type->t_is_enum))
422 if (tn->tn_type->t_is_enum && cs->c_switch_type->t_is_enum &&
423 tn->tn_type->u.enumer == cs->c_switch_type->u.enumer)
429 type_name(tn->tn_type));
462 check_case_label(tnode_t *tn)
474 if (tn == NULL)
477 if (tn->tn_op != CON) {
483 if (!is_integer(tn->tn_type->t_tspec)) {
489 check_case_label_bitand(tn, cs->c_switch_expr);
490 check_case_label_enum(tn, cs);
500 tspec_t t = tn->tn_type->t_tspec;
506 val_t *v = integer_constant(tn, true);
517 case_label(tnode_t *tn)
519 check_case_label(tn);
551 check_controlling_expression(tnode_t *tn, bool is_do_while)
553 tn = cconv(tn);
554 if (tn != NULL)
555 tn = promote(NOOP, false, tn);
557 if (tn != NULL && !is_scalar(tn->tn_type->t_tspec)) {
566 if (tn != NULL && Tflag
567 && !is_typeok_bool_compares_with_zero(tn, is_do_while)) {
569 error(333, tn->tn_type->t_is_enum ? type_name(tn->tn_type)
570 : tspec_name(tn->tn_type->t_tspec));
573 return tn;
577 stmt_if_expr(tnode_t *tn)
579 if (tn != NULL)
580 tn = check_controlling_expression(tn, false);
581 if (tn != NULL)
582 expr(tn, false, true, false, false, "if");
585 if (tn != NULL && tn->tn_op == CON && !tn->tn_system_dependent) {
587 set_reached(constant_is_nonzero(tn));
615 stmt_switch_expr(tnode_t *tn)
617 if (tn != NULL)
618 tn = cconv(tn);
619 if (tn != NULL)
620 tn = promote(NOOP, false, tn);
621 if (tn != NULL && !is_integer(tn->tn_type->t_tspec)) {
624 tn = NULL;
626 if (tn != NULL && !allow_c90) {
627 tspec_t t = tn->tn_type->t_tspec;
639 if (tn != NULL) {
640 tp->t_tspec = tn->tn_type->t_tspec;
641 if ((tp->t_is_enum = tn->tn_type->t_is_enum) != false)
642 tp->u.enumer = tn->tn_type->u.enumer;
651 expr(tn, true, false, false, false, "switch");
656 cstmt->c_switch_expr = tn;
715 stmt_while_expr(tnode_t *tn)
724 if (tn != NULL)
725 tn = check_controlling_expression(tn, false);
729 cstmt->c_maybe_endless = is_nonzero(tn);
730 bool body_reached = !is_zero(tn);
732 check_getopt_begin_while(tn);
733 expr(tn, false, true, true, false, "while");
760 stmt_do_while_expr(tnode_t *tn)
765 if (tn != NULL)
766 tn = check_controlling_expression(tn, true);
768 if (tn != NULL && tn->tn_op == CON) {
769 cstmt->c_maybe_endless = constant_is_nonzero(tn);
775 expr(tn, false, true, true, true, "do-while");
914 is_parenthesized(const tnode_t *tn)
916 while (!tn->tn_parenthesized && tn->tn_op == COMMA)
917 tn = tn->u.ops.right;
918 return tn->tn_parenthesized && !tn->tn_sys;
922 check_return_value(bool sys, tnode_t *tn)
924 if (any_query_enabled && is_parenthesized(tn))
935 tnode_t *retn = build_binary(ln, RETURN, sys, tn);
951 stmt_return(bool sys, tnode_t *tn)
964 if (tn != NULL)
969 if (tn != NULL && funcsym->s_type->t_subt->t_tspec == VOID) {
973 tn = NULL;
975 if (tn == NULL && funcsym->s_type->t_subt->t_tspec != VOID
985 if (tn != NULL)
986 check_return_value(sys, tn);