Removed the id_enum macro and replaced id_struct by id_tag (better name)
This commit is contained in:
parent
ca104453ca
commit
240dd55fd9
6 changed files with 15 additions and 23 deletions
|
@ -379,7 +379,7 @@ enum_specifier(register struct type **tpp;)
|
||||||
{
|
{
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
if (options['g']) {
|
if (options['g']) {
|
||||||
stb_tag(idf->id_enum, idf->id_text);
|
stb_tag(idf->id_tag, idf->id_text);
|
||||||
}
|
}
|
||||||
#endif /*DBSYMTAB */
|
#endif /*DBSYMTAB */
|
||||||
}
|
}
|
||||||
|
@ -446,14 +446,14 @@ struct_or_union_specifier(register struct type **tpp;)
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
declare_struct(fund, idf, tpp);
|
declare_struct(fund, idf, tpp);
|
||||||
(idf->id_struct->tg_busy)++;
|
(idf->id_tag->tg_busy)++;
|
||||||
}
|
}
|
||||||
struct_declaration_pack(*tpp)
|
struct_declaration_pack(*tpp)
|
||||||
{
|
{
|
||||||
(idf->id_struct->tg_busy)--;
|
(idf->id_tag->tg_busy)--;
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
if (options['g']) {
|
if (options['g']) {
|
||||||
stb_tag(idf->id_struct, idf->id_text);
|
stb_tag(idf->id_tag, idf->id_text);
|
||||||
}
|
}
|
||||||
#endif /*DBSYMTAB */
|
#endif /*DBSYMTAB */
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,19 +138,12 @@ dumpidf(idf, opt)
|
||||||
}
|
}
|
||||||
dumpsdefs(idf->id_sdef, selector);
|
dumpsdefs(idf->id_sdef, selector);
|
||||||
}
|
}
|
||||||
if (idf->id_struct) {
|
if (idf->id_tag) {
|
||||||
if (!started++) {
|
if (!started++) {
|
||||||
newline();
|
newline();
|
||||||
print("%s:", idf->id_text);
|
print("%s:", idf->id_text);
|
||||||
}
|
}
|
||||||
dumptags(idf->id_struct);
|
dumptags(idf->id_tag);
|
||||||
}
|
|
||||||
if (idf->id_enum) {
|
|
||||||
if (!started++) {
|
|
||||||
newline();
|
|
||||||
print("%s:", idf->id_text);
|
|
||||||
}
|
|
||||||
dumptags(idf->id_enum);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct id_u {
|
||||||
struct def *idd_label; /* labels */
|
struct def *idd_label; /* labels */
|
||||||
struct def *idd_def; /* variables, typedefs, enum-constants */
|
struct def *idd_def; /* variables, typedefs, enum-constants */
|
||||||
struct sdef *idd_sdef; /* selector tags */
|
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 */
|
int idd_special; /* special action needed at occurrence */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,8 +31,7 @@ struct id_u {
|
||||||
#define id_label id_user.idd_label
|
#define id_label id_user.idd_label
|
||||||
#define id_def id_user.idd_def
|
#define id_def id_user.idd_def
|
||||||
#define id_sdef id_user.idd_sdef
|
#define id_sdef id_user.idd_sdef
|
||||||
#define id_struct id_user.idd_struct
|
#define id_tag id_user.idd_tag
|
||||||
#define id_enum id_user.idd_struct
|
|
||||||
#define id_special id_user.idd_special
|
#define id_special id_user.idd_special
|
||||||
|
|
||||||
#include <idf_pkg.spec>
|
#include <idf_pkg.spec>
|
||||||
|
|
|
@ -183,7 +183,7 @@ struct idf **idpp;
|
||||||
switch(tp->tp_fund) {
|
switch(tp->tp_fund) {
|
||||||
case ENUM:
|
case ENUM:
|
||||||
case UNION:
|
case UNION:
|
||||||
case STRUCT: tg = tp->tp_idf->id_struct; break;
|
case STRUCT: tg = tp->tp_idf->id_tag; break;
|
||||||
}
|
}
|
||||||
return tg;
|
return tg;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ struct type *tp;
|
||||||
switch (tp->tp_fund) {
|
switch (tp->tp_fund) {
|
||||||
case ENUM:
|
case ENUM:
|
||||||
case STRUCT:
|
case STRUCT:
|
||||||
case UNION: tgpp = &(ident->id_struct); break;
|
case UNION: tgpp = &(ident->id_tag); break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,11 +150,11 @@ unstack_level()
|
||||||
idf->id_sdef = sdef->next;
|
idf->id_sdef = sdef->next;
|
||||||
free_sdef(sdef);
|
free_sdef(sdef);
|
||||||
}
|
}
|
||||||
while ( (tag = idf->id_struct)
|
while ( (tag = idf->id_tag)
|
||||||
&& tag->tg_level >= level
|
&& tag->tg_level >= level
|
||||||
) {
|
) {
|
||||||
/* unlink it from the struct list under the idf block */
|
/* unlink it from the struct list under the idf block */
|
||||||
idf->id_struct = tag->next;
|
idf->id_tag = tag->next;
|
||||||
free_tag(tag);
|
free_tag(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */
|
||||||
extern arith add_field();
|
extern arith add_field();
|
||||||
#endif NOBITFIELD
|
#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;
|
struct sdef *sdef = idf->id_sdef;
|
||||||
register struct sdef *newsdef;
|
register struct sdef *newsdef;
|
||||||
int lvl = tg->tg_level;
|
int lvl = tg->tg_level;
|
||||||
|
@ -183,7 +183,7 @@ declare_struct(fund, idf, tpp)
|
||||||
if (*tpp) error("multiple types in declaration");
|
if (*tpp) error("multiple types in declaration");
|
||||||
if (!idf)
|
if (!idf)
|
||||||
idf = gen_idf();
|
idf = gen_idf();
|
||||||
tgp = &idf->id_struct;
|
tgp = &idf->id_tag;
|
||||||
tg = *tgp;
|
tg = *tgp;
|
||||||
if (tg
|
if (tg
|
||||||
&& tg->tg_type->tp_size < 0
|
&& tg->tg_type->tp_size < 0
|
||||||
|
@ -243,7 +243,7 @@ apply_struct(fund, idf, tpp)
|
||||||
*/
|
*/
|
||||||
register struct tag **tgp;
|
register struct tag **tgp;
|
||||||
|
|
||||||
tgp = &idf->id_struct;
|
tgp = &idf->id_tag;
|
||||||
|
|
||||||
if (*tgp)
|
if (*tgp)
|
||||||
*tpp = (*tgp)->tg_type;
|
*tpp = (*tgp)->tg_type;
|
||||||
|
|
Loading…
Reference in a new issue