[Janitor] Cleanup in f77
Andreas Jaeger
aj@suse.de
Sat Jun 7 17:07:00 GMT 2003
I removed the undefined FFEBLD_BLANK_, FFETARGET_isENFORCED_MAIN_NAME
and FFECOM_itemHOOK macros and removed all tests for the
FFECOM_...HOOKs which are always defined. This cleans up the files
slightly.
The following macros are also not defined anywhere:
FFESTD_F90
FFETARGET_okCHARACTER2
FFETARGET_okCHARACTER3
FFETARGET_okCHARACTER4
FFETARGET_okCHARACTER5
FFETARGET_okCHARACTER6
FFETARGET_okCHARACTER7
FFETARGET_okCHARACTER8
FFETARGET_okCOMPLEX4
FFETARGET_okCOMPLEX5
FFETARGET_okCOMPLEX6
FFETARGET_okCOMPLEX7
FFETARGET_okCOMPLEX8
FFETARGET_okINTEGER5
FFETARGET_okINTEGER6
FFETARGET_okINTEGER7
FFETARGET_okINTEGER8
FFETARGET_okLOGICAL5
FFETARGET_okLOGICAL6
FFETARGET_okLOGICAL7
FFETARGET_okLOGICAL8
FFETARGET_okREAL4
FFETARGET_okREAL5
FFETARGET_okREAL6
FFETARGET_okREAL7
FFETARGET_okREAL8
Should we remove them also?
Bootstrapped/regtested on i686-linux-gnu.
Ok to commit?
Andreas
2003-06-07 Andreas Jaeger <aj@suse.de>
* f/symbol.c (ffesymbol_new_): Remove tests for macro
FFECOM_symbolHOOK.
* f/symbol.h: Likewise.
* f/storag.c (ffestorag_new): Remove tests for macro
FFECOM_storageHOOK.
* f/storag.h: Likewise.
* f/lab.c (ffelab_new): Remove tests for macro FFECOM_labelHOOK.
* f/lab.h: Likewise.
* f/global.c: Remove tests for macro FFECOM_globalHOOK.
* f/global.h (struct _ffeglobal_): Likewise.
* f/bld.h: Remove tests for macros FFECOM_constantHOOK,
FFECOM_nonterHOOK, FFECOM_globalHOOK, FFECOM_labelHOOK,
FFECOM_storageHOOK, FFECOM_symbolHOOK.
Remove code dependend on FFECOM_itemHOOK.
* f/bld.c: Likewise.
* f/com.h (FFECOM_constantHOOK): Remove define.
(FFECOM_nonterHOOK): Remove.
(FFECOM_globalHOOK): Remove.
(FFECOM_labelHOOK): Remove.
(FFECOM_storageHOOK): Remove.
(FFECOM_symbolHOOK): Remove.
* f/com.c (ffecom_get_external_identifier_): Remove usage of
FFETARGET_isENFORCED_MAIN_NAME.
* f/bld.c: Remove code dependend on FFEBLD_BLANK_, FFECOM_itemHOOK.
(ffebld_new_accter): Likewise.
(ffebld_new_arrter): Likewise.
(ffebld_new_conter_with_orig): Likewise.
(ffebld_new_item): Likewise.
(ffebld_new_labter): Likewise.
(ffebld_new_labtok): Likewise.
(ffebld_new_none): Likewise.
(ffebld_new_one): Likewise.
(ffebld_new_symter): Likewise.
(ffebld_new_two): Likewise.
============================================================
Index: gcc/f/bld.c
--- gcc/f/bld.c 28 May 2002 17:32:58 -0000 1.13
+++ gcc/f/bld.c 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* bld.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -70,16 +70,6 @@ struct _ffebld_pool_stack_ ffebld_pool_s
/* Static objects accessed by functions in this module. */
-#if FFEBLD_BLANK_
-static struct _ffebld_ ffebld_blank_
-=
-{
- 0,
- {FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0, FFEINFO_kindNONE,
- FFEINFO_whereNONE, FFETARGET_charactersizeNONE},
- {NULL, NULL}
-};
-#endif
#if FFETARGET_okCHARACTER1
static ffebldConstant ffebld_constant_character1_;
#endif
@@ -715,9 +705,7 @@ ffebld_constant_new_character1_val (ffet
nc->next = c->next;
nc->consttype = FFEBLD_constCHARACTER1;
nc->u.character1 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -773,9 +761,7 @@ ffebld_constant_new_complex1_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constCOMPLEX1;
nc->u.complex1 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -831,9 +817,7 @@ ffebld_constant_new_complex2_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constCOMPLEX2;
nc->u.complex2 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -881,9 +865,7 @@ ffebld_constant_new_hollerith_val (ffeta
nc->next = c->next;
nc->consttype = FFEBLD_constHOLLERITH;
nc->u.hollerith = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -938,9 +920,7 @@ ffebld_constant_new_integer1_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constINTEGER1;
nc->u.integer1 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -976,9 +956,7 @@ ffebld_constant_new_integer2_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constINTEGER2;
nc->u.integer2 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1014,9 +992,7 @@ ffebld_constant_new_integer3_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constINTEGER3;
nc->u.integer3 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1052,9 +1028,7 @@ ffebld_constant_new_integer4_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constINTEGER4;
nc->u.integer4 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1165,9 +1139,7 @@ ffebld_constant_new_logical1_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constLOGICAL1;
nc->u.logical1 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1203,9 +1175,7 @@ ffebld_constant_new_logical2_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constLOGICAL2;
nc->u.logical2 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1241,9 +1211,7 @@ ffebld_constant_new_logical3_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constLOGICAL3;
nc->u.logical3 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1279,9 +1247,7 @@ ffebld_constant_new_logical4_val (ffetar
nc->next = c->next;
nc->consttype = FFEBLD_constLOGICAL4;
nc->u.logical4 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1335,9 +1301,7 @@ ffebld_constant_new_real1_val (ffetarget
nc->next = c->next;
nc->consttype = FFEBLD_constREAL1;
nc->u.real1 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1391,9 +1355,7 @@ ffebld_constant_new_real2_val (ffetarget
nc->next = c->next;
nc->consttype = FFEBLD_constREAL2;
nc->u.real2 = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -1557,9 +1519,7 @@ ffebld_constant_new_typeless_val (ffebld
nc->next = c->next;
nc->consttype = type;
nc->u.typeless = val;
-#ifdef FFECOM_constantHOOK
nc->hook = FFECOM_constantNULL;
-#endif
c->next = nc;
return nc;
@@ -4231,9 +4191,6 @@ ffebld_new_accter (ffebldConstantArray a
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opACCTER;
x->u.accter.array = a;
x->u.accter.bits = b;
@@ -4254,9 +4211,6 @@ ffebld_new_arrter (ffebldConstantArray a
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opARRTER;
x->u.arrter.array = a;
x->u.arrter.size = size;
@@ -4276,9 +4230,6 @@ ffebld_new_conter_with_orig (ffebldConst
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opCONTER;
x->u.conter.expr = c;
x->u.conter.orig = o;
@@ -4297,15 +4248,9 @@ ffebld_new_item (ffebld head, ffebld tra
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opITEM;
x->u.item.head = head;
x->u.item.trail = trail;
-#ifdef FFECOM_itemHOOK
- x->u.item.hook = FFECOM_itemNULL;
-#endif
return x;
}
@@ -4321,9 +4266,6 @@ ffebld_new_labter (ffelab l)
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opLABTER;
x->u.labter = l;
return x;
@@ -4346,9 +4288,6 @@ ffebld_new_labtok (ffelexToken t)
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opLABTOK;
x->u.labtok = t;
return x;
@@ -4365,9 +4304,6 @@ ffebld_new_none (ffebldOp o)
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = o;
return x;
}
@@ -4383,14 +4319,9 @@ ffebld_new_one (ffebldOp o, ffebld left)
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = o;
x->u.nonter.left = left;
-#ifdef FFECOM_nonterHOOK
x->u.nonter.hook = FFECOM_nonterNULL;
-#endif
return x;
}
@@ -4410,9 +4341,6 @@ ffebld_new_symter (ffesymbol s, ffeintri
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = FFEBLD_opSYMTER;
x->u.symter.symbol = s;
x->u.symter.generic = gen;
@@ -4433,15 +4361,10 @@ ffebld_new_two (ffebldOp o, ffebld left,
ffebld x;
x = ffebld_new ();
-#if FFEBLD_BLANK_
- *x = ffebld_blank_;
-#endif
x->op = o;
x->u.nonter.left = left;
x->u.nonter.right = right;
-#ifdef FFECOM_nonterHOOK
x->u.nonter.hook = FFECOM_nonterNULL;
-#endif
return x;
}
============================================================
Index: gcc/f/com.c
--- gcc/f/com.c 7 Jun 2003 11:10:45 -0000 1.199
+++ gcc/f/com.c 7 Jun 2003 12:40:54 -0000
@@ -6047,11 +6047,7 @@ ffecom_get_external_identifier_ (ffesymb
if (!ffe_is_underscoring ()
|| (strcmp (name, FFETARGET_nameBLANK_COMMON) == 0)
-#if FFETARGET_isENFORCED_MAIN_NAME
- || (strcmp (name, FFETARGET_nameENFORCED_NAME) == 0)
-#else
|| (strcmp (name, FFETARGET_nameUNNAMED_MAIN) == 0)
-#endif
|| (strcmp (name, FFETARGET_nameUNNAMED_BLOCK_DATA) == 0))
return get_identifier (name);
============================================================
Index: gcc/f/global.c
--- gcc/f/global.c 12 Sep 2001 16:52:41 -0000 1.12
+++ gcc/f/global.c 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* global.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -110,9 +110,7 @@ ffeglobal_new_ (ffename n)
g = (ffeglobal) malloc_new_ks (malloc_pool_image (), "FFEGLOBAL",
sizeof (*g));
g->n = n;
-#ifdef FFECOM_globalHOOK
g->hook = FFECOM_globalNULL;
-#endif
g->tick = 0;
ffename_set_global (n, g);
@@ -1430,9 +1428,7 @@ ffeglobal_ref_progunit_ (ffesymbol s, ff
/* We've learned more, so point to where we learned it. */
g->t = ffelex_token_use (t);
g->type = type;
-#ifdef FFECOM_globalHOOK
g->hook = FFECOM_globalNULL; /* Discard previous _DECL. */
-#endif
g->u.proc.n_args = -1;
}
============================================================
Index: gcc/f/lab.c
--- gcc/f/lab.c 15 Feb 1999 18:17:04 -0000 1.4
+++ gcc/f/lab.c 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* lab.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -143,9 +143,7 @@ ffelab_new (ffelabValue v)
++ffelab_num_news_;
l = (ffelab) malloc_new_ks (ffe_pool_any_unit (), "FFELAB label", sizeof (*l));
l->next = ffelab_list_;
-#ifdef FFECOM_labelHOOK
l->hook = FFECOM_labelNULL;
-#endif
l->value = v;
l->firstref_line = ffewhere_line_unknown ();
l->firstref_col = ffewhere_column_unknown ();
============================================================
Index: gcc/f/storag.c
--- gcc/f/storag.c 15 Feb 1999 18:17:36 -0000 1.4
+++ gcc/f/storag.c 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* storag.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -420,9 +420,7 @@ ffestorag_new (ffestoragList sl)
sizeof (*s));
s->next = (ffestorag) &sl->first;
s->previous = sl->last;
-#ifdef FFECOM_storageHOOK
s->hook = FFECOM_storageNULL;
-#endif
s->previous->next = s;
sl->last = s;
s->equivs_.first = s->equivs_.last = (ffestorag) &s->equivs_.first;
============================================================
Index: gcc/f/symbol.c
--- gcc/f/symbol.c 17 Oct 2001 22:34:54 -0000 1.11
+++ gcc/f/symbol.c 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,6 @@
/* Implementation of Fortran symbol manager
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2003
+ Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -230,9 +231,7 @@ ffesymbol_new_ (ffename n)
s->common = NULL;
s->equiv = NULL;
s->storage = NULL;
-#ifdef FFECOM_symbolHOOK
s->hook = FFECOM_symbolNULL;
-#endif
s->sfa_dummy_parent = NULL;
s->func_result = NULL;
s->value = 0;
============================================================
Index: gcc/f/bld.h
--- gcc/f/bld.h 23 Dec 2001 04:59:08 -0000 1.12
+++ gcc/f/bld.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* bld.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -400,18 +400,13 @@ struct _ffebld_
{
ffebld left;
ffebld right;
-#ifdef FFECOM_nonterHOOK
ffecomNonter hook; /* Whatever the compiler/backend wants! */
-#endif
}
nonter;
struct
{
ffebld head;
ffebld trail;
-#ifdef FFECOM_itemHOOK
- ffecomItem hook; /* Whatever the compiler/backend wants! */
-#endif
}
item;
struct
@@ -459,9 +454,7 @@ struct _ffebld_constant_
real. */
ffebldConstant negated; /* We point to each other through here. */
ffebldConst consttype;
-#ifdef FFECOM_constantHOOK
ffecomConstant hook; /* Whatever the compiler/backend wants! */
-#endif
bool numeric; /* A numeric kind of constant. */
ffebldConstantUnion u;
};
============================================================
Index: gcc/f/com.h
--- gcc/f/com.h 22 Mar 2003 13:01:07 -0000 1.28
+++ gcc/f/com.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,6 @@
/* com.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2000, 2003
+ Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -128,17 +129,11 @@ typedef enum
#endif
typedef tree ffecomConstant;
-#define FFECOM_constantHOOK
typedef tree ffecomNonter;
-#define FFECOM_nonterHOOK
typedef tree ffecomLabel;
-#define FFECOM_globalHOOK
typedef tree ffecomGlobal;
-#define FFECOM_labelHOOK
typedef tree ffecomStorage;
-#define FFECOM_storageHOOK
typedef struct _ffecom_symbol_ ffecomSymbol;
-#define FFECOM_symbolHOOK
struct _ffecom_symbol_
{
============================================================
Index: gcc/f/global.h
--- gcc/f/global.h 17 Oct 2001 22:34:52 -0000 1.9
+++ gcc/f/global.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* global.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -89,9 +89,7 @@ struct _ffeglobal_
{
ffelexToken t;
ffename n;
-#ifdef FFECOM_globalHOOK
ffecomGlobal hook;
-#endif
ffeCounter tick; /* Recent transition in this progunit. */
ffeglobalType type;
bool intrinsic; /* Known as intrinsic? */
============================================================
Index: gcc/f/lab.h
--- gcc/f/lab.h 26 May 2001 01:31:46 -0000 1.5
+++ gcc/f/lab.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* lab.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -70,9 +70,7 @@ typedef unsigned long ffelabValue;
struct _ffelab_
{
ffelab next;
-#ifdef FFECOM_labelHOOK
ffecomLabel hook;
-#endif
ffelabValue value; /* 1 through 99999, or 100000+ for temp
labels. */
unsigned long blocknum; /* Managed entirely by user of module. */
============================================================
Index: gcc/f/storag.h
--- gcc/f/storag.h 26 May 2001 01:31:46 -0000 1.5
+++ gcc/f/storag.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* storag.h -- Public #include File (module.h template V1.0)
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -83,9 +83,7 @@ struct _ffestorag_
LOCAL. */
ffetargetAlign alignment; /* Initial alignment for entity. */
ffetargetAlign modulo; /* Modulo within alignment. */
-#ifdef FFECOM_storageHOOK
ffecomStorage hook; /* Whatever the backend needs here. */
-#endif
ffestoragType type;
ffeinfoBasictype basic_type;/* NONE= >1 non-CHARACTER; ANY=
CHAR+non-CHAR. */
============================================================
Index: gcc/f/symbol.h
--- gcc/f/symbol.h 17 Oct 2001 22:34:54 -0000 1.9
+++ gcc/f/symbol.h 7 Jun 2003 12:40:54 -0000
@@ -1,5 +1,5 @@
/* Interface definitions for Fortran symbol manager
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -121,9 +121,7 @@ struct _ffesymbol_
ffeequiv equiv; /* Who have I been equivalenced with? */
ffestorag storage; /* Where am I in relation to my outside
world? */
-#ifdef FFECOM_symbolHOOK
ffecomSymbol hook; /* Whatever the compiler/backend wants! */
-#endif
ffesymbol sfa_dummy_parent; /* "X" outside sfunc "CIRC(X) = 3.14 * X". */
ffesymbol func_result; /* FUN sym's corresponding RES sym, & vice
versa. */
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Gcc-patches
mailing list