This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
move typedefs for rtx,tree,rtvec to config.h,tconfig.h and hconfig.h
- From: Graham Stott <grahams at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 01 Jan 2002 09:13:30 +0000
- Subject: move typedefs for rtx,tree,rtvec to config.h,tconfig.h and hconfig.h
All,
This patch moves the forwards defs for rtx_def, union_tree and rtvec_def
and corresponding typedefs for rtx, tree and rtvec from system.h to
the configuration files config.h, hconfig.h, tconfig.h
Moving these to the config files provides a singe point where these
struct tags are forward declared and allows the typedefs to be used
in all GCC files. At the moment they cannot be used in the backend
files because the cpu dependent header files are included before
system.h
bootstrapped i686-pc-linux-gnu + all languages no regressions.
Also built mips-elf cross compiler.
Graham
ChangeLog
* mkconfig.sh: Output to config.h, hconfig.h and tconfig.h
forward defs for struct tags rtx_def, union_tree, rtvec_def
also output corresponding typedefs for rtxm, tree, and rtvcec.
* system.h: Move forward defs for struct tags rtx_def, union_tree,
rtvec_def along with corresponding typedefs for rtx, tree, and
rtvcec to config.h, hconfig.h, tconfig.h
-------------------------------------------------------------------
Index: mkconfig.sh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/mkconfig.sh,v
retrieving revision 1.7
diff -c -p -r1.7 mkconfig.sh
*** mkconfig.sh 2001/11/19 23:12:41 1.7
--- mkconfig.sh 2002/01/01 09:03:10
*************** if [ -n "$HEADERS" ]; then
*** 35,40 ****
--- 35,61 ----
esac
fi
+ # Provide three core typedefs used by everything, if we are compiling
+ # GCC. These used to be found in rtl.h and tree.h, but this is no
+ # longer practical. Providing these in config.h/tconfig.h/hconfig.h
+ # rather than system.h allows the typedefs to be used anywhere in GCC.
+ case $output in
+ *config.h | *hconfig.h | *tconfig.h)
+ echo "#ifdef IN_GCC"
+ echo "/* Provide three core typedefs used by everything, if we are compiling"
+ echo " GCC. These used to be found in rtl.h and tree.h, but this is no"
+ echo " longer practical. Providing these here rather that system.h allows"
+ echo " the typedefs to be used everywhere within GCC. */"
+ echo "struct rtx_def;"
+ echo "typedef struct rtx_def *rtx;"
+ echo "struct rtvec_def;"
+ echo "typedef struct rtvec_def *rtvec;"
+ echo "union tree_node;"
+ echo "typedef union tree_node *tree;"
+ echo "#endif"
+ ;;
+ esac
+
if [ -n "$HEADERS" ]; then
echo '#ifdef IN_GCC'
for file in $HEADERS; do
-------------------------------------------------------------------
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.110
diff -c -p -r1.110 system.h
*** system.h 2001/12/28 18:17:54 1.110
--- system.h 2002/01/01 09:04:06
*************** typedef char _Bool;
*** 557,574 ****
#define TRUE true
#define FALSE false
- /* Provide three core typedefs used by everything, if we are compiling
- GCC. These used to be found in rtl.h and tree.h, but this is no
- longer practical. */
- #ifdef IN_GCC
- struct rtx_def;
- struct rtvec_def;
- union tree_node;
- typedef struct rtx_def *rtx;
- typedef struct rtvec_def *rtvec;
- typedef union tree_node *tree;
- #endif
-
/* As the last action in this file, we poison the identifiers that
shouldn't be used. Note, luckily gcc-3.0's token-based integrated
preprocessor won't trip on poisoned identifiers that arrive from
--- 557,562 ----
---------------------------------------------------------------------