FreeBSD/contrib/gcc/cp/decl.c
/* Define a label, specifying the location in the source file.
   Return the LABEL_DECL node for the label.  */
Define a label, specifying the location in the source file.
Return the LABEL_DECL node for the label.
Define a label specifying the location in the source file . Return the LABEL_DECL node for the label .
tree
define_label (location_t location, tree name)
{
  struct named_label_entry *ent, dummy;
  struct cp_binding_level *p;
  tree decl;
  timevar_push (TV_NAME_LOOKUP);
  decl = lookup_label (name);
  dummy.label_decl = decl;
  ent = (struct named_label_entry *) htab_find (named_labels, &dummy);
  gcc_assert (ent != NULL);
  for (p = current_binding_level;
       p->kind != sk_function_parms;
       p = p->level_chain)
    p->more_cleanups_ok = 0;
  if (name == get_identifier ("wchar_t"))
    pedwarn ("label named wchar_t");
  if (DECL_INITIAL (decl) != NULL_TREE)
    {
      error ("duplicate label %qD", decl);
      POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
    }
  else
    {
      struct named_label_use_entry *use;
      DECL_INITIAL (decl) = error_mark_node;
      DECL_SOURCE_LOCATION (decl) = location;
      ent->binding_level = current_binding_level;
      ent->names_in_scope = current_binding_level->names;
      for (use = ent->uses; use ; use = use->next)
	check_previous_goto (decl, use);
      ent->uses = NULL;
    }
  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
tree define_label ( location_t location , tree name ) { struct named_label_entry * ent , dummy ; struct cp_binding_level * p ; tree decl ; timevar_push ( TV_NAME_LOOKUP ) ; decl = lookup_label ( name ) ; dummy . label_decl = decl ; ent = ( struct named_label_entry * ) htab_find ( named_labels , & dummy ) ; gcc_assert ( ent != NULL ) ; for ( p = current_binding_level ; p -> kind != sk_function_parms ; p = p -> level_chain ) p -> more_cleanups_ok = 0 ; if ( name == get_identifier ( " " ) ) pedwarn ( " " ) ; if ( DECL_INITIAL ( decl ) != NULL_TREE ) { error ( " " , decl ) ; POP_TIMEVAR_AND_RETURN ( TV_NAME_LOOKUP , error_mark_node ) ; } else { struct named_label_use_entry * use ; DECL_INITIAL ( decl ) = error_mark_node ; DECL_SOURCE_LOCATION ( decl ) = location ; ent -> binding_level = current_binding_level ; ent -> names_in_scope = current_binding_level -> names ; for ( use = ent -> uses ; use ; use = use -> next ) check_previous_goto ( decl , use ) ; ent -> uses = NULL ; } POP_TIMEVAR_AND_RETURN ( TV_NAME_LOOKUP , decl ) ; }
Define a label, specifying the location in the source file.
Define a label specifying the location in the source file .
/* After labels, make any new cleanups in the function go into their
     own new (temporary) binding contour.  */ /* Mark label as having been defined.  */ /* Say where in the source.  */