This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal macros as functions, RFC (patch too, but incomplete)


Hi.

Please don't check this in.

It is incomplet, possibly inkorrekt.  It did survive a bootstrap on
i686-pc-linux-gnulibc1 and rudimentary testing shows that it
works as expected, maybe even usefully.

I'm just sending it to check with you that I'm not completely
off track here, and there's always a good flame war to get
caught in (HHOS ;-)

Prototype ChangeLog entry:
Wed Dec 22 16:44:31 1999  Hans-Peter Nilsson  <hp@bitrange.com>

	* system.h (PROVIDE_MACRO_FUNCTION, PROVIDE_MACRO_VALUE): New.

	* Makefile.in (OBJS): Add xmacfuns.o.
	(STAGESTUFF): Add xmacfuns.c and s-macfuns.
	(xmacfuns.o, xmacfuns.c, s-macfuns): New.
	(MACRO_FUNCTION_DEFINITION_FILES): New

	* genmacfuns: New script to generate functions from macros.

	* rtl.h: Use PROVIDE_MACRO_VALUE and PROVIDE_MACRO_FUNCTION.

Missing pieces:
- aclocal.m4: Patch for AC_SAME_MACRO_AS_FUNCTION

- rtl.h: Similar to the below patch.

- tree.h: Similar.

- Makefile.in: Move xmacfuns.o to last in OBJS, maybe other moves.


Known issues:
- Should genmacfuns be C instead of a shell script?

- How to get macro definitions from other languages?  Like with
  LANG_EXTRA_HEADERS?  Should/can I just use LANG_EXTRA_HEADERS?

- People with wider experience with broken compilers: Is there
  really a *need* for checking that the bootstrap compiler
  accepts "#define FOO(a,b)" and a function "(FOO)(a,b)" in the
  same translation unit?  Is it right to be cautious here?

- Do we need configury to turn off linking with xmacfuns.o?  If
  so, I think it should be default on.  Size for xmacfuns.o with
  stuff below:
   text	   data	    bss	    dec	    hex	filename
   1271	      4	      0	   1275	    4fb	xmacfuns.o

- Names OK?
  genmacfuns
  xmacfuns.c
  PROVIDE_MACRO_(VALUE|FUNCTION)
  s-xmacfuns

- Are the function prototypes in rtl.h OK?

- Do we need linker magic support for some linkers to keep-in
  the macro functions although seemingly unused, unreferenced?

- Papers are in place (actually all over the place).

- Should I check this in myself if approved, as everything seems
  to be set up?

*** /dev/null	Tue Jan  1 05:00:00 1980
--- genmacfuns	Wed Dec 22 08:29:30 1999
***************
*** 0 ****
--- 1,169 ----
+ #! /bin/sh
+ # Generates xmacfuns.c.
+ #   Copyright (C) 1999 Free Software Foundation, Inc.
+ 
+ #This file is part of GNU CC.
+ 
+ #GNU CC is free software; you can redistribute it and/or modify
+ #it under the terms of the GNU General Public License as published by
+ #the Free Software Foundation; either version 2, or (at your option)
+ #any later version.
+ 
+ #GNU CC is distributed in the hope that it will be useful,
+ #but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #GNU General Public License for more details.
+ 
+ #You should have received a copy of the GNU General Public License
+ #along with GNU CC; see the file COPYING.  If not, write to
+ #the Free Software Foundation, 59 Temple Place - Suite 330,
+ #Boston, MA 02111-1307, USA.
+ 
+ # This shell script produces a C file which is compiled into GCC to
+ # provide function equivalents for common internal macros, to
+ # simplify debugging of GCC if that would ever be needed.  Right...
+ 
+ # The arguments are each a header file, containing lines that look
+ # like:
+ #  PROVIDE_MACRO_FUNCTION (name, type, (args))
+ #  PROVIDE_MACRO_VALUE (name, type, value)
+ # for example:
+ #  PROVIDE_MACRO_VALUE (NUM_RTX_CODE, const int, LAST_AND_UNUSED_RTX_CODE)
+ # and
+ #  PROVIDE_MACRO_FUNCTION (XEXP, rtx, (rtx, int))
+ # or
+ #  PROVIDE_MACRO_FUNCTION (PUT_CODE, void, (rtx, enum rtx_code))
+ #
+ # For PROVIDE_MACRO_VALUE, we collect them, to be emitted last to avoid
+ # problems with undefining macros.
+ # There, we emit #undef of the name, and "type name = value;", as in:
+ #
+ #   #undef NUM_RTX_CODE
+ #   const int NUM_RTX_CODE = LAST_AND_UNUSED_RTX_CODE;
+ #
+ # If value is empty, only "type name;" is emitted after the #undef.
+ #
+ # For PROVIDE_MACRO_FUNCTION lines we output code.  If "type" is "void"
+ # as in:
+ #  PROVIDE_MACRO_FUNCTION (PUT_CODE, void, (rtx, enum rtx_code))
+ # we emit:
+ #
+ #   void
+ #   (PUT_CODE) (arg0, arg1)
+ #	 rtx arg0;
+ #	 enum rtx_code arg1;
+ #   {
+ #     PUT_CODE (arg0, arg1);
+ #   }
+ #
+ # else, like for XEXP, we emit:
+ #
+ #   rtx
+ #   (XEXP) (arg0, arg1)
+ #	 rtx arg0;
+ #	 int arg1;
+ #   {
+ #     return XEXP (arg0, arg1);
+ #   }
+ #
+ 
+ # Caveats and general FIXME:s:
+ #
+ # - We do not provide anything that can be used as an lvalue, as XEXP is
+ #   used sometimes.
+ #
+ # - There is no warranty that the value definitions get in a sane order;
+ #   the #undef:s can cause just as much trouble between each of them as
+ #   for the macro functions.
+ 
+ echo "/* WARNING: This file is automatically generated by $0 ! */"
+ echo '#include "config.h"'
+ echo '#include "system.h"'
+ 
+ files=
+ for infile in $*
+ do
+   echo '#include "'$infile'"'
+   files="$files $infile"
+ done
+ 
+ echo
+ echo '#if defined(HAVE_MACRONAME_AS_IDENTIFIER) || defined(__GNUC__)'
+ echo
+ 
+ undefs=
+ vars=
+ 
+ for infile in $files
+ do
+   # First, collect all macro values.
+   newvars=`sed -n -e 's/[	 ]/:/g;' -e 's/^PROVIDE_MACRO_VALUE[:]*(\(.*\))/\1/pg;' < $infile`
+   vars="$vars $newvars"
+ 
+   # Then untangle the declaration-like PROVIDE_MACRO_FUNCTION
+   for funcmacro in \
+  `sed -n -e 's/[	 ]/:/g;' -e 's/^PROVIDE_MACRO_FUNCTION[:]*(\([^,]*\),[:]*\([^,]*\),[:]*(\([^)]*\)))/\1@\2@\3/pg;' < $infile`
+   do
+     name=`echo $funcmacro | sed -e 's/^\([^@]*\)@.*/\1/;' -e 's/:/ /g;'`
+     type=`echo $funcmacro | sed -e 's/^[^@]*@\([^@]*\)@.*/\1/;' -e 's/:/ /g;'`
+     argtypes=`echo $funcmacro | sed -e 's/^[^@]*@[^@]*@\([^@]*\)/\1/g;' -e 's/,[:]*/ /g;'`
+ 
+     # Construct the arguments list
+     nargs=0
+     args=
+     delim=
+     for argtype in $argtypes
+     do
+       args="$args${delim}arg$nargs"
+       nargs=`expr $nargs + 1`
+       delim=", "
+     done
+ 
+     echo "$type"
+     echo "($name) ($args)"
+ 
+     # Write out the argument types (old style).
+     narg=0
+     for arg in $argtypes
+     do
+       argtype=`echo $arg | sed -e 's/:/ /g;'`
+       echo "     $argtype arg$narg;"
+       narg=`expr $narg + 1`
+     done
+        
+     echo '{'
+ 
+     if test "$type" = "void"
+     then
+       echo "  $name ($args);"
+     else
+       echo "  return $name ($args);"
+     fi
+ 
+     echo '}'
+     echo
+   done
+ done
+ 
+ echo
+ 
+ # Now, go through the macro values, and emit definitions.
+ for var in $vars
+ do
+   name=`echo $var | sed -e 's/^\([^,]*\),.*/\1/;' -e 's/:/ /g;'`
+   type=`echo $var | sed -e 's/^[^,]*,[:]*\([^,]*\),.*/\1/;' -e 's/:/ /g;'`
+   value=`echo $var | sed -e 's/^[^,]*,[^,]*,[:]*\(.*\)/\1/g;' -e 's/:/ /g;'`
+ 
+   echo "#undef $name"
+ 
+   if test "X$value" != "X"
+   then 
+     echo "$type $name = $value;"
+   else
+     echo "$type $name;"
+   fi
+   echo
+ done
+ 
+ echo '#endif /* HAVE_MACRONAME_AS_IDENTIFIER || __GNUC__ */'
+ exit 0
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.158
diff -p -c -r1.158 rtl.h
*** rtl.h	1999/12/04 03:00:03	1.158
--- rtl.h	1999/12/22 14:18:48
*************** enum rtx_code  {
*** 50,66 ****
--- 50,72 ----
  #define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
  				/* The cast here, saves many elsewhere.  */
  
+ PROVIDE_MACRO_VALUE(NUM_RTX_CODE, int, LAST_AND_UNUSED_RTX_CODE)
+ 
  extern const int rtx_length[];
  #define GET_RTX_LENGTH(CODE)		(rtx_length[(int) (CODE)])
+ PROVIDE_MACRO_FUNCTION (GET_RTX_LENGTH, int, (int))
  
  extern const char * const rtx_name[];
  #define GET_RTX_NAME(CODE)		(rtx_name[(int) (CODE)])
+ PROVIDE_MACRO_FUNCTION (GET_RTX_NAME, const char *, (int))
  
  extern const char * const rtx_format[];
  #define GET_RTX_FORMAT(CODE)		(rtx_format[(int) (CODE)])
+ PROVIDE_MACRO_FUNCTION (GET_RTX_FORMAT, const char *, (int))
  
  extern const char rtx_class[];
  #define GET_RTX_CLASS(CODE)		(rtx_class[(int) (CODE)])
+ PROVIDE_MACRO_FUNCTION (GET_RTX_CLASS, int, (int))
  
  /* The flags and bitfields of an ADDR_DIFF_VEC.  BASE is the base label
     relative to which the offsets are calculated, as explained in rtl.def.  */
*************** typedef struct rtx_def
*** 191,203 ****
--- 197,219 ----
  #define PUT_CODE(RTX, CODE)	((RTX)->code = (CODE))
  #endif
  
+ PROVIDE_MACRO_FUNCTION (GET_CODE, enum rtx_code, (rtx))
+ PROVIDE_MACRO_FUNCTION (PUT_CODE, void, (rtx, enum rtx_code))
+ 
  #define GET_MODE(RTX)		((RTX)->mode)
  #define PUT_MODE(RTX, MODE)	((RTX)->mode = (MODE))
  
+ PROVIDE_MACRO_FUNCTION (GET_MODE, enum machine_mode, (rtx))
+ PROVIDE_MACRO_FUNCTION (PUT_MODE, void, (rtx, enum machine_mode))
+ 
  #define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
  #define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
  #define RTX_FRAME_RELATED_P(RTX) ((RTX)->frame_related)
  
+ PROVIDE_MACRO_FUNCTION (RTX_INTEGRATED_P, int, (rtx))
+ PROVIDE_MACRO_FUNCTION (RTX_UNCHANGING_P, int, (rtx))
+ PROVIDE_MACRO_FUNCTION (RTX_FRAME_RELATED_P, int, (rtx))
+ 
  /* RTL vector.  These appear inside RTX's when there is a need
     for a variable number of things.  The principle use is inside
     PARALLEL expressions.  */
*************** typedef struct rtvec_def{
*** 208,220 ****
--- 224,241 ----
  } *rtvec;
  
  #define NULL_RTVEC (rtvec) 0
+ PROVIDE_MACRO_VALUE (NULL_RTVEC, const rtvec, 0)
  
  #define GET_NUM_ELEM(RTVEC)		((RTVEC)->num_elem)
  #define PUT_NUM_ELEM(RTVEC, NUM)	((RTVEC)->num_elem = (NUM))
  
+ PROVIDE_MACRO_FUNCTION (GET_NUM_ELEM, int, (rtvec))
+ PROVIDE_MACRO_FUNCTION (PUT_NUM_ELEM, void, (rtvec, int))
+ 
  /* 1 if X is a REG.  */
  
  #define REG_P(X) (GET_CODE (X) == REG)
+ PROVIDE_MACRO_FUNCTION (REG_P, int, (rtx))
  
  /* 1 if X is a constant value that is an integer.  */
  
*************** typedef struct rtvec_def{
*** 223,228 ****
--- 244,250 ----
     || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE		\
     || GET_CODE (X) == CONST || GET_CODE (X) == HIGH			\
     || GET_CODE (X) == CONSTANT_P_RTX)
+ PROVIDE_MACRO_FUNCTION (CONSTANT_P, int, (rtx))
  
  /* General accessor macros for accessing the fields of an rtx.  */
  
*************** extern void rtvec_check_failed_bounds PR
*** 303,308 ****
--- 325,332 ----
  
  #endif
  
+ PROVIDE_MACRO_FUNCTION (RTVEC_ELT, rtx, (rtvec, int))
+ 
  #define XWINT(RTX, N)	(RTL_CHECK1(RTX, N, 'w').rtwint)
  #define XINT(RTX, N)	(RTL_CHECK2(RTX, N, 'i', 'n').rtint)
  #define XSTR(RTX, N)	(RTL_CHECK2(RTX, N, 's', 'S').rtstr)
*************** extern void rtvec_check_failed_bounds PR
*** 313,321 ****
--- 337,358 ----
  #define XTREE(RTX, N)   (RTL_CHECK1(RTX, N, 't').rttree)
  #define XBBDEF(RTX, N)	(RTL_CHECK1(RTX, N, 'B').bb)
  
+ PROVIDE_MACRO_FUNCTION (XWINT, HOST_WIDE_INT, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XINT, int, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XSTR, char *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XEXP, rtx, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XVEC, rtvec, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XMODE, enum machine_mode, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XBITMAP, struct bitmap_head_def *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XTREE, union tree_node *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (XBBDEF, struct basic_block_def *, (rtx, int))
+ 
  #define XVECEXP(RTX, N, M)	RTVEC_ELT (XVEC (RTX, N), M)
  #define XVECLEN(RTX, N)		GET_NUM_ELEM (XVEC (RTX, N))
  
+ PROVIDE_MACRO_FUNCTION (XVECEXP, rtx, (rtx, int, int))
+ PROVIDE_MACRO_FUNCTION (XVECLEN, int, (rtx, int))
+ 
  /* These are like XWINT, etc. except that they expect a '0' field instead
     of the normal type code.  */
  
*************** extern void rtvec_check_failed_bounds PR
*** 330,335 ****
--- 367,386 ----
  #define X0BBDEF(RTX, N)	   (RTL_CHECK1(RTX, N, '0').bb)
  #define X0ADVFLAGS(RTX, N) (RTL_CHECK1(RTX, N, '0').rt_addr_diff_vec_flags)
  
+ PROVIDE_MACRO_FUNCTION (X0WINT, HOST_WIDE_INT, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0INT, int, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0STR, char *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0EXP, rtx, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0VEC, rtvec, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0MODE, enum machine_mode, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0BITMAP, struct bitmap_head_def *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0TREE, union tree_node *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0BBDEF, struct basic_block_def *, (rtx, int))
+ PROVIDE_MACRO_FUNCTION (X0ADVFLAGS, addr_diff_vec_flags, (rtx, int))
+ 
+ /* These macros above are only used within this file, so they get no
+    function-equivalents. */
+ 
  #define XCWINT(RTX, N, C)     (RTL_CHECKC1(RTX, N, C).rtwint)
  #define XCINT(RTX, N, C)      (RTL_CHECKC1(RTX, N, C).rtint)
  #define XCSTR(RTX, N, C)      (RTL_CHECKC1(RTX, N, C).rtstr)
*************** extern void rtvec_check_failed_bounds PR
*** 351,367 ****
--- 402,424 ----
  /* Holds a unique number for each insn.
     These are not necessarily sequentially increasing.  */
  #define INSN_UID(INSN)  XINT(INSN, 0)
+ PROVIDE_MACRO_FUNCTION (INSN_UID, int, (rtx))
  
  /* Chain insns together in sequence.  */
  #define PREV_INSN(INSN)	XEXP(INSN, 1)
  #define NEXT_INSN(INSN)	XEXP(INSN, 2)
  
+ PROVIDE_MACRO_FUNCTION (PREV_INSN, rtx, (rtx))
+ PROVIDE_MACRO_FUNCTION (NEXT_INSN, rtx, (rtx))
+ 
  /* The body of an insn.  */
  #define PATTERN(INSN)	XEXP(INSN, 3)
+ PROVIDE_MACRO_FUNCTION (PATTERN, rtx, (rtx))
  
  /* Code number of instruction, from when it was recognized.
     -1 means this instruction has not been recognized yet.  */
  #define INSN_CODE(INSN) XINT(INSN, 4)
+ PROVIDE_MACRO_FUNCTION (INSN_CODE, int, (rtx))
  
  /* Set up in flow.c; empty before then.
     Holds a chain of INSN_LIST rtx's whose first operands point at
*************** extern void rtvec_check_failed_bounds PR
*** 369,380 ****
--- 426,440 ----
     That means that those insns set variables whose next use is in this insn.
     They are always in the same basic block as this insn.  */
  #define LOG_LINKS(INSN)	XEXP(INSN, 5)
+ PROVIDE_MACRO_FUNCTION (LOG_LINKS, rtx, (rtx))
  
  /* 1 if insn has been deleted.  */
  #define INSN_DELETED_P(INSN) ((INSN)->volatil)
+ PROVIDE_MACRO_FUNCTION (INSN_DELETED, int, (rtx))
  
  /* 1 if insn is a call to a const function.  */
  #define CONST_CALL_P(INSN) ((INSN)->unchanging)
+ PROVIDE_MACRO_FUNCTION (CONST_CALL_P, int, (rtx))
  
  /* 1 if insn is a branch that should not unconditionally execute its
     delay slots, i.e., it is an annulled branch.   */
Index: system.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/system.h,v
retrieving revision 1.52
diff -p -c -r1.52 system.h
*** system.h	1999/09/22 14:23:21	1.52
--- system.h	1999/12/22 14:18:50
*************** extern void abort ();
*** 528,531 ****
--- 528,546 ----
  /* Get libiberty declarations. */
  #include "libiberty.h"
  
+ /* If this compiler accepts #define FOO(a,b) and functions like
+    (FOO)(a,b), provide a macro for declaring (FOO)(a,b).
+     Since we do not run configure more than once, also check for
+    __GNUC__ so the later-stage compilers get the macro functions
+    independently of the compiler used for bootstrap.  */
+ #if defined(HAVE_MACRONAME_AS_IDENTIFIER) || defined(__GNUC__)
+ # define PROVIDE_MACRO_FUNCTION(fn, rtype, args) \
+      extern rtype (fn) PROTO (args);
+ #else
+ # define PROVIDE_MACRO_FUNCTION(fn, rtype, args)
+ #endif /* HAVE_MACRONAME_AS_IDENTIFIER || __GNUC__ */
+ 
+ /* Usage of this macro is picked up by genmacfuns.  */
+ #define PROVIDE_MACRO_VALUE(name, vtype, value)
+ 
  #endif /* __GCC_SYSTEM_H__ */
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.353
diff -p -c -r1.353 Makefile.in
*** Makefile.in	1999/12/21 17:27:23	1.353
--- Makefile.in	1999/12/22 14:19:03
*************** C_AND_OBJC_OBJS = c-lex.o c-pragma.o c-d
*** 656,662 ****
  C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
  
  # Language-independent object files.
! OBJS = diagnostic.o \
   toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
   function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
   builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
--- 656,662 ----
  C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
  
  # Language-independent object files.
! OBJS = xmacfuns.o diagnostic.o \
   toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
   function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
   builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
*************** CCCP=@cpp_main@
*** 680,689 ****
  # Files to be copied away after each stage in building.
  STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
   insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
!  insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h \
   s-flags s-config s-codes s-mlib s-unders s-genrtl \
   s-output s-recog s-emit s-extract s-peep s-check \
!  s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 \
   genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
   genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
   genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
--- 680,689 ----
  # Files to be copied away after each stage in building.
  STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
   insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
!  insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h xmacfuns.c \
   s-flags s-config s-codes s-mlib s-unders s-genrtl \
   s-output s-recog s-emit s-extract s-peep s-check \
!  s-attr s-attrtab s-opinit s-crt s-crtS s-crt0 s-macfuns \
   genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
   genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
   genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
*************** s-under: $(GCC_PASSES)
*** 1394,1399 ****
--- 1394,1413 ----
  
  c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
  	c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H) ggc.h
+ 
+ # Generated functions from macro definitions.
+ xmacfuns.o : xmacfuns.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H)
+ 
+ # Note that files here are explicitly mentioned here (not as part of
+ # e.g. $(RTL_H)) as they are actual input.
+ # FIXME: We also need get language-specific macros processed here.
+ MACRO_FUNCTION_DEFINITION_FILES = $(srcdir)/rtl.h $(srcdir)/tree.h
+ xmacfuns.c : s-macfuns ; @true
+ s-macfuns : $(srcdir)/genmacfuns $(srcdir)/move-if-change \
+  $(MACRO_FUNCTION_DEFINITION_FILES)
+ 	$(SHELL) $(srcdir)/genmacfuns $(MACRO_FUNCTION_DEFINITION_FILES) > tmp-xmacfuns.c
+ 	$(SHELL) $(srcdir)/move-if-change tmp-xmacfuns.c xmacfuns.c
+ 	touch s-macfuns
  
  # Language-independent files.
  
brgds, H-P



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]