FreeBSD/contrib/gcc/c-decl.c
/* Begin compiling the definition of an enumeration type.
   NAME is its name (or null if anonymous).
   Returns the type object, as yet incomplete.
   Also records info about it so that build_enumerator
   may be used to declare the individual values as they are read.  */
Begin compiling the definition of an enumeration type.
NAME is its name (or null if anonymous).
Returns the type object, as yet incomplete.
Also records info about it so that build_enumerator
may be used to declare the individual values as they are read.
Begin compiling the definition of an enumeration type . NAME is its name ( or null if anonymous ) . Returns the type object as yet incomplete . Also records info about it so that build_enumerator may be used to declare the individual values as they are read .
tree
start_enum (tree name)
{
  tree enumtype = 0;
  if (name != 0)
    enumtype = lookup_tag (ENUMERAL_TYPE, name, 1);
  if (enumtype == 0 || TREE_CODE (enumtype) != ENUMERAL_TYPE)
    {
      enumtype = make_node (ENUMERAL_TYPE);
      pushtag (name, enumtype);
    }
  if (C_TYPE_BEING_DEFINED (enumtype))
    error ("nested redefinition of %<enum %E%>", name);
  C_TYPE_BEING_DEFINED (enumtype) = 1;
  if (TYPE_VALUES (enumtype) != 0)
    {
      error ("redeclaration of %<enum %E%>", name);
      TYPE_VALUES (enumtype) = 0;
    }
  enum_next_value = integer_zero_node;
  enum_overflow = 0;
  if (flag_short_enums)
    TYPE_PACKED (enumtype) = 1;
  return enumtype;
}
tree start_enum ( tree name ) { tree enumtype = 0 ; if ( name != 0 ) enumtype = lookup_tag ( ENUMERAL_TYPE , name , 1 ) ; if ( enumtype == 0 || TREE_CODE ( enumtype ) != ENUMERAL_TYPE ) { enumtype = make_node ( ENUMERAL_TYPE ) ; pushtag ( name , enumtype ) ; } if ( C_TYPE_BEING_DEFINED ( enumtype ) ) error ( " " , name ) ; C_TYPE_BEING_DEFINED ( enumtype ) = 1 ; if ( TYPE_VALUES ( enumtype ) != 0 ) { error ( " " , name ) ; TYPE_VALUES ( enumtype ) = 0 ; } enum_next_value = integer_zero_node ; enum_overflow = 0 ; if ( flag_short_enums ) TYPE_PACKED ( enumtype ) = 1 ; return enumtype ; }
Begin compiling the definition of an enumeration type.
Begin compiling the definition of an enumeration type .
/* If this is the real definition for a previous forward reference,
     fill in the contents in the same object that used to be the
     forward reference.  */ /* This enum is a named one that has been declared already.  */ /* Completely replace its old definition.
	 The old enumerators remain defined, however.  */