Removed the id_enum macro and replaced id_struct by id_tag (better name)
authorceriel <none@none>
Mon, 8 Jul 1991 16:49:04 +0000 (16:49 +0000)
committerceriel <none@none>
Mon, 8 Jul 1991 16:49:04 +0000 (16:49 +0000)
lang/cem/cemcom.ansi/declar.g
lang/cem/cemcom.ansi/dumpidf.c
lang/cem/cemcom.ansi/idf.str
lang/cem/cemcom.ansi/proto.c
lang/cem/cemcom.ansi/stack.c
lang/cem/cemcom.ansi/struct.c

index 4a22814..61065fb 100644 (file)
@@ -379,7 +379,7 @@ enum_specifier(register struct type **tpp;)
                        {
 #ifdef DBSYMTAB
                                if (options['g']) {
-                                       stb_tag(idf->id_enum, idf->id_text);
+                                       stb_tag(idf->id_tag, idf->id_text);
                                }
 #endif /*DBSYMTAB */
                        }
@@ -446,14 +446,14 @@ struct_or_union_specifier(register struct type **tpp;)
                [
                        {
                                declare_struct(fund, idf, tpp);
-                               (idf->id_struct->tg_busy)++;
+                               (idf->id_tag->tg_busy)++;
                        }
                        struct_declaration_pack(*tpp)
                        {
-                               (idf->id_struct->tg_busy)--;
+                               (idf->id_tag->tg_busy)--;
 #ifdef DBSYMTAB
                                if (options['g']) {
-                                       stb_tag(idf->id_struct, idf->id_text);
+                                       stb_tag(idf->id_tag, idf->id_text);
                                }
 #endif /*DBSYMTAB */
                        }
index e929b97..7f66583 100644 (file)
@@ -138,19 +138,12 @@ dumpidf(idf, opt)
                }
                dumpsdefs(idf->id_sdef, selector);
        }
-       if (idf->id_struct)     {
+       if (idf->id_tag)        {
                if (!started++) {
                        newline();
                        print("%s:", idf->id_text);
                }
-               dumptags(idf->id_struct);
-       }
-       if (idf->id_enum)       {
-               if (!started++) {
-                       newline();
-                       print("%s:", idf->id_text);
-               }
-               dumptags(idf->id_enum);
+               dumptags(idf->id_tag);
        }
 }
 
index 9f77001..f9e2ad2 100644 (file)
@@ -18,7 +18,7 @@ struct id_u {
        struct def *idd_label;  /* labels                               */
        struct def *idd_def;    /* variables, typedefs, enum-constants  */
        struct sdef *idd_sdef;  /* selector tags                        */
-       struct tag *idd_struct; /* struct and union tags                */
+       struct tag *idd_tag;    /* struct, union, and enum tags         */
        int idd_special;        /* special action needed at occurrence  */
 };
 
@@ -31,8 +31,7 @@ struct id_u {
 #define id_label       id_user.idd_label
 #define id_def         id_user.idd_def
 #define id_sdef                id_user.idd_sdef
-#define id_struct      id_user.idd_struct
-#define id_enum                id_user.idd_struct
+#define id_tag         id_user.idd_tag
 #define id_special     id_user.idd_special
 
 #include <idf_pkg.spec>
index 81e7fce..768e5d3 100644 (file)
@@ -183,7 +183,7 @@ struct idf **idpp;
        switch(tp->tp_fund) {
        case ENUM:
        case UNION:
-       case STRUCT: tg = tp->tp_idf->id_struct; break;
+       case STRUCT: tg = tp->tp_idf->id_tag; break;
        }
        return tg;
 }
@@ -333,7 +333,7 @@ struct type *tp;
        switch (tp->tp_fund) {
        case ENUM:
        case STRUCT:
-       case UNION: tgpp = &(ident->id_struct); break;
+       case UNION: tgpp = &(ident->id_tag); break;
        default: return;
        }
 
index a9bcc62..5e6433d 100644 (file)
@@ -150,11 +150,11 @@ unstack_level()
                        idf->id_sdef = sdef->next;
                        free_sdef(sdef);
                }
-               while ( (tag = idf->id_struct)
+               while ( (tag = idf->id_tag)
                &&      tag->tg_level >= level
                )       {
                        /* unlink it from the struct list under the idf block */
-                       idf->id_struct = tag->next;
+                       idf->id_tag = tag->next;
                        free_tag(tag);
                }
        }
index dc01bcd..ebac4e4 100644 (file)
@@ -72,7 +72,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd)        /* this is horrible */
        extern arith add_field();
 #endif NOBITFIELD
 
-       struct tag *tg = stp->tp_idf->id_struct;        /* or union */
+       struct tag *tg = stp->tp_idf->id_tag;   /* or union */
        struct sdef *sdef = idf->id_sdef;
        register struct sdef *newsdef;
        int lvl = tg->tg_level;
@@ -183,7 +183,7 @@ declare_struct(fund, idf, tpp)
        if (*tpp) error("multiple types in declaration");
        if (!idf)
                idf = gen_idf();
-       tgp = &idf->id_struct;
+       tgp = &idf->id_tag;
        tg = *tgp;
        if (tg
            && tg->tg_type->tp_size < 0
@@ -243,7 +243,7 @@ apply_struct(fund, idf, tpp)
        */
        register struct tag **tgp;
 
-       tgp = &idf->id_struct;
+       tgp = &idf->id_tag;
 
        if (*tgp)
                *tpp = (*tgp)->tg_type;