Lines Matching refs:label

77       if (DECL_NAME (ent->label))
79 gcc_assert (DECL_INITIAL (ent->label) != NULL_TREE);
80 labels.safe_push (ent->label);
312 /* Return TRUE if IDENT is the current function return label. */
322 /* Define a label, specifying the location in the source file.
323 Return the LABEL_DECL node for the label. */
327 tree label = this->lookup_label (s, ident);
328 gcc_assert (DECL_INITIAL (label) == NULL_TREE);
333 /* Mark label as having been defined. */
334 DECL_INITIAL (label) = error_mark_node;
342 return label;
347 void do_label (tree label)
349 /* Don't write out label unless it is marked as used by the frontend.
353 if (TREE_USED (label))
354 add_stmt (build1 (LABEL_EXPR, void_type_node, label));
359 void do_jump (tree label)
361 add_stmt (fold_build1 (GOTO_EXPR, void_type_node, label));
362 TREE_USED (label) = 1;
365 /* Check that a new jump at statement scope FROM to a label declared in
373 /* If the label hasn't been defined yet, defer checking. */
374 if (! DECL_INITIAL (ent->label))
392 /* Check that a previously seen jump to a newly defined label is valid.
393 S is the label statement; FWDREF is the jump context. This is called
440 error ("label %s referenced outside of any function",
445 /* Create the label htab for the function on demand. */
454 return ent->label;
466 ent->label = decl;
489 TREE_VEC_ELT (vec, bc_break) = ent->label;
491 /* Build the continue label. */
492 tree label = build_decl (make_location_t (s->loc), LABEL_DECL,
494 DECL_CONTEXT (label) = current_function_decl;
495 DECL_MODE (label) = VOIDmode;
496 TREE_VEC_ELT (vec, bc_continue) = label;
498 ent->label = vec;
505 /* Set and return the current break label for the current block. */
509 tree label = this->lookup_bc_label (s->getRelatedLabeled (), bc_break);
510 DECL_CHAIN (label) = this->break_label_;
511 this->break_label_ = label;
512 return label;
515 /* Finish with the current break label. */
517 void pop_break_label (tree label)
519 gcc_assert (this->break_label_ == label);
521 this->do_label (label);
524 /* Set and return the continue label for the current block. */
528 tree label = this->lookup_bc_label (s->getRelatedLabeled (), bc_continue);
529 DECL_CHAIN (label) = this->continue_label_;
530 this->continue_label_ = label;
531 return label;
534 /* Finish with the current continue label. */
536 void pop_continue_label (tree label)
538 gcc_assert (this->continue_label_ == label);
540 this->do_label (label);
543 /* Generate and set a new continue label for the current unrolled loop. */
550 /* Finish with the continue label for the unrolled loop. */
558 this->pop_continue_label (TREE_VEC_ELT (ent->label, bc_continue));
560 /* Remove the continue label from the label htab, as a new one must be
562 ent->label = TREE_VEC_ELT (ent->label, bc_break);
724 /* Jump to the associated exit label for the current loop. If IDENT
725 for the Statement is not null, then the label is user defined. */
731 /* The break label may actually be some levels up.
733 LabelStatement *label = this->func_->searchLabel (s->ident)->statement;
734 gcc_assert (label != NULL);
735 Statement *stmt = label->statement->getRelatedLabeled ();
742 /* Jump to the associated continue label for the current loop. If IDENT
743 for the Statement is not null, then the label is user defined. */
749 LabelStatement *label = this->func_->searchLabel (s->ident)->statement;
750 gcc_assert (label != NULL);
751 this->do_jump (this->lookup_bc_label (label->statement,
758 /* A goto statement jumps to the statement identified by the given label. */
762 gcc_assert (s->label->statement != NULL);
763 gcc_assert (s->tf == s->label->statement->tf);
765 /* If no label found, there was an error. */
766 tree label = this->lookup_label (s->label->statement, s->label->ident);
767 this->do_jump (label);
770 this->check_goto (s, s->label->statement);
773 /* Statements can be labeled. A label is an identifier that precedes
785 /* If no label found, there was an error. */
786 tree label = this->define_label (sym->statement, sym->ident);
787 TREE_USED (label) = 1;
789 this->do_label (label);
880 Also checking the jump from the switch to the label is allowed. */
910 /* The default label is the last 'else' block. */
942 /* If the switch had any 'break' statements, emit the label now. */
947 /* Declare the case label associated with the current SwitchStatement. */
951 /* Emit the case label. */
952 tree label = this->define_label (s);
954 if (LABEL_VARIABLE_CASE (label))
955 this->do_label (label);
964 tree caselabel = build_case_label (casevalue, NULL_TREE, label);
973 /* Declare the default label associated with the current SwitchStatement. */
977 /* Emit the default case label. */
978 tree label = this->define_label (s);
980 if (LABEL_VARIABLE_CASE (label))
981 this->do_label (label);
984 tree caselabel = build_case_label (NULL_TREE, NULL_TREE, label);
993 /* Implements 'goto default' by jumping to the label associated with
998 tree label = this->lookup_label (s->sw->sdefault);
999 this->do_jump (label);
1002 /* Implements 'goto case' by jumping to the label associated with the
1007 tree label = this->lookup_label (s->cs);
1008 this->do_jump (label);
1085 is nested inside and given their own continue label to jump to. */
1368 by the front-end, so pass down the label symbol to the back-end. */
1376 gcc_assert (gs->label->statement != NULL);
1377 gcc_assert (gs->tf == gs->label->statement->tf);
1381 tree label = this->lookup_label (gs->label->statement,
1382 gs->label->ident);
1383 TREE_USED (label) = 1;
1385 labels = chainon (labels, build_tree_list (name, label));