]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in (TARGET_H, [...]): New.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Tue, 26 Jun 2001 18:09:27 +0000 (18:09 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Tue, 26 Jun 2001 18:09:27 +0000 (18:09 +0000)
* Makefile.in (TARGET_H, TARGET_DEF_H): New.
(c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update.
* c-decl.c (duplicate_decls): Use function pointer.
* c-typeck.c (common_type): Similarly.
* tree.c (valid_machine_attribute): Similarly.
(merge_machine_type_attributes): Rename merge_type_attributes.
(merge_machine_decl_attributes): Rename merge_decl_attributes.
(merge_dllimport_decl_attributes): New function.
* tree.h (merge_machine_type_attributes): Rename merge_type_attributes.
(merge_machine_decl_attributes): Rename merge_decl_attributes.
(merge_dllimport_decl_attributes): New prototype.
* target.h: New.
* target-def.h: New.

doc: (Joseph Myers)
* doc/gcc.texi, doc/tm.texi: Update documentation.

cp: Make-lang.in: Update dependencies.
* spew.c: Include target.h.
(duplicate_decls): Call target function.
* decl2.c: include target.h
(import_export_class): Use existence of target function pointer.
* typeck.c: Include target.h.
(qualify_type_recursive): Rename variable.  Call target function.
(type_after_usual_arithmetic_conversions): Similarly.
(common_type): Similarly.

config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c,
d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c,
i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c,
m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c,
mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c,
pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c,
sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c)
: Include target.h and target-def.h.  Define target.

* arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove.
* arc/arc.c (arc_valid_machine_decl_attribute): Rename
arc_valid_decl_attribute, make static.
* arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* arm/arm-protos.h (arm_valid_machine_decl_attribute,
arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute,
arm_pe_merge_machine_decl_attributes): Remove.
* arm/arm.c (arm_valid_machine_decl_attribute_p): Rename
arm_valid_decl_attribute_p, make static.
(arm_pe_valid_decl_attribute_p): Move from pe.c.
* arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c.
(arm_pe_merge_machine_decl_attributes): Move to tree.c.
* arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New.
(VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* avr/avr-protos.h (valid_machine_type_attribute,
valid_machine_decl_attribute): Remove.
* avr/avr.c (valid_machine_type_attribute,
valid_machine_decl_attribute): Rename and make static.
* avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE,
VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove.
* c4x/c4x.c (c4x_valid_type_attribute_p): Make static.
* c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* d30v/d30v.h: Remove obsolete comments.
* h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove.
* h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make
static.
* h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
(i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES,
i386_pe_valid_type_attributes_p): Remove.
* i386/i386-protos.h (ix86_valid_decl_attribute_p,
ix86_valid_type_attribute_p): Remove.
* i386/i386.c (ix86_valid_decl_attribute_p): Remove.
(ix86_valid_type_attribute_p): Make static.
* i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c.
* ia64/ia64-protos.h (ia64_valid_type_attribute): Remove.
* ia64/ia64.c (ia64_valid_type_attribute): Make static.
* ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove.
* m32r/m32r.c (m32r_valid_decl_attribute): Make static.
* m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p,
m68hc11_valid_type_attribute_p): Remove.
* m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove.
(m68hc11_valid_type_attribute_p): Make static.
* m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* mcore/mcore-protos.h (mcore_valid_machine_decl_attribute,
mcore_merge_machine_decl_attribute): Remove.
* mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename,
make static.
(mcore_merge_machine_decl_attributes): Move to tree.c.
* mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
(TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
* ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p,
ns32k_valid_type_attribute_p): Remove.
* ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove.
(ns32k_valid_type_attribute_p): Make static.
* ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p,
rs6000_valid_type_attribute_p): Remove.
* rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove.
(rs6000_valid_type_attribute_p): Make static.
* rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove.
* sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static.
* sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
* v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove.
* v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static.
* v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.

From-SVN: r43585

87 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/c-decl.c
gcc/c-typeck.c
gcc/config/1750a/1750a.c
gcc/config/a29k/a29k.c
gcc/config/alpha/alpha.c
gcc/config/arc/arc-protos.h
gcc/config/arc/arc.c
gcc/config/arc/arc.h
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/coff.h
gcc/config/arm/elf.h
gcc/config/arm/pe.c
gcc/config/arm/pe.h
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.h
gcc/config/c4x/c4x-protos.h
gcc/config/c4x/c4x.c
gcc/config/c4x/c4x.h
gcc/config/clipper/clipper.c
gcc/config/convex/convex.c
gcc/config/d30v/d30v.c
gcc/config/d30v/d30v.h
gcc/config/dsp16xx/dsp16xx.c
gcc/config/elxsi/elxsi.c
gcc/config/fr30/fr30.c
gcc/config/h8300/h8300-protos.h
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h
gcc/config/i370/i370.c
gcc/config/i386/cygwin.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/winnt.c
gcc/config/i860/i860.c
gcc/config/i960/i960.c
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h
gcc/config/m32r/m32r-protos.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/m68hc11/m68hc11-protos.h
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h
gcc/config/m68k/m68k.c
gcc/config/m88k/m88k.c
gcc/config/mcore/mcore-protos.h
gcc/config/mcore/mcore.c
gcc/config/mcore/mcore.h
gcc/config/mips/mips.c
gcc/config/mn10200/mn10200.c
gcc/config/mn10300/mn10300.c
gcc/config/ns32k/ns32k-protos.h
gcc/config/ns32k/ns32k.c
gcc/config/ns32k/ns32k.h
gcc/config/pa/pa.c
gcc/config/pdp11/pdp11.c
gcc/config/pj/pj.c
gcc/config/romp/romp.c
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/sparc/sparc.c
gcc/config/v850/v850-protos.h
gcc/config/v850/v850.c
gcc/config/v850/v850.h
gcc/config/vax/vax.c
gcc/config/we32k/we32k.c
gcc/cp/Make-lang.in
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/typeck.c
gcc/doc/gcc.texi
gcc/doc/tm.texi
gcc/target-def.h [new file with mode: 0644]
gcc/target.h [new file with mode: 0644]
gcc/tree.c
gcc/tree.h

index d1dac4c50de76c03841a376aa9512086401556cd..7f59344137eb94549ae6880e08347ef977df78e2 100644 (file)
@@ -1,3 +1,122 @@
+2001-06-26  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * Makefile.in (TARGET_H, TARGET_DEF_H): New.
+       (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update.
+       * c-decl.c (duplicate_decls): Use function pointer.
+       * c-typeck.c (common_type): Similarly.
+       * tree.c (valid_machine_attribute): Similarly.
+       (merge_machine_type_attributes): Rename merge_type_attributes.
+       (merge_machine_decl_attributes): Rename merge_decl_attributes.
+       (merge_dllimport_decl_attributes): New function.
+       * tree.h (merge_machine_type_attributes): Rename merge_type_attributes.
+       (merge_machine_decl_attributes): Rename merge_decl_attributes.
+       (merge_dllimport_decl_attributes): New prototype.
+       * target.h: New.
+       * target-def.h: New.
+
+doc:   (Joseph Myers)
+       * doc/gcc.texi, doc/tm.texi: Update documentation.
+
+cp:    Make-lang.in: Update dependencies.
+       * spew.c: Include target.h.
+       (duplicate_decls): Call target function.
+       * decl2.c: include target.h
+       (import_export_class): Use existence of target function pointer.
+       * typeck.c: Include target.h.
+       (qualify_type_recursive): Rename variable.  Call target function.
+       (type_after_usual_arithmetic_conversions): Similarly.
+       (common_type): Similarly.
+
+config:        * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
+       avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c,
+       d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c,
+       i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c,
+       m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c,
+       mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c,
+       pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c,
+       sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c)
+       : Include target.h and target-def.h.  Define target.
+
+       * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove.
+       * arc/arc.c (arc_valid_machine_decl_attribute): Rename
+       arc_valid_decl_attribute, make static.
+       * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * arm/arm-protos.h (arm_valid_machine_decl_attribute,
+       arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute,
+       arm_pe_merge_machine_decl_attributes): Remove.
+       * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename
+       arm_valid_decl_attribute_p, make static.
+       (arm_pe_valid_decl_attribute_p): Move from pe.c.
+       * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c.
+       (arm_pe_merge_machine_decl_attributes): Move to tree.c.
+       * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New.
+       (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * avr/avr-protos.h (valid_machine_type_attribute,
+       valid_machine_decl_attribute): Remove.
+       * avr/avr.c (valid_machine_type_attribute,
+       valid_machine_decl_attribute): Rename and make static.
+       * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE,
+       VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove.
+       * c4x/c4x.c (c4x_valid_type_attribute_p): Make static.
+       * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * d30v/d30v.h: Remove obsolete comments.
+       * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove.
+       * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make
+       static.
+       * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
+       (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES,
+       i386_pe_valid_type_attributes_p): Remove.
+       * i386/i386-protos.h (ix86_valid_decl_attribute_p,
+       ix86_valid_type_attribute_p): Remove.
+       * i386/i386.c (ix86_valid_decl_attribute_p): Remove.
+       (ix86_valid_type_attribute_p): Make static.
+       * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE,
+       VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c.
+       * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove.
+       * ia64/ia64.c (ia64_valid_type_attribute): Make static.
+       * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove.
+       * m32r/m32r.c (m32r_valid_decl_attribute): Make static.
+       * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p,
+       m68hc11_valid_type_attribute_p): Remove.
+       * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove.
+       (m68hc11_valid_type_attribute_p): Make static.
+       * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE,
+       VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute,
+       mcore_merge_machine_decl_attribute): Remove.
+       * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename,
+       make static.
+       (mcore_merge_machine_decl_attributes): Move to tree.c.
+       * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE,
+       VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define.
+       * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p,
+       ns32k_valid_type_attribute_p): Remove.
+       * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove.
+       (ns32k_valid_type_attribute_p): Make static.
+       * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE,
+       VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p,
+       rs6000_valid_type_attribute_p): Remove.
+       * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove.
+       (rs6000_valid_type_attribute_p): Make static.
+       * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE,
+       VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
+       * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove.
+       * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static.
+       * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+       * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove.
+       * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static.
+       * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove.
+
 2001-06-26  Vladimir Makarov  <vmakarov@toke.toronto.redhat.com>
 
        * glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold
index 563e7b718d67b3d954ea425a69f25fe03634c957..811a94407176be4bf8b865dfbf5dafd72f116e7d 100644 (file)
@@ -552,6 +552,8 @@ GCONFIG_H = config.h $(host_xm_file_list)
 HCONFIG_H = hconfig.h $(build_xm_file_list)
 CONFIG_H = $(GCONFIG_H) insn-codes.h insn-flags.h
 TCONFIG_H = tconfig.h $(xm_file_list) insn-codes.h
+TARGET_H = target.h
+TARGET_DEF_H = target-def.h
 TM_P_H = tm_p.h $(tm_p_file_list) insn-codes.h
 
 MACHMODE_H = machmode.h machmode.def
@@ -1148,10 +1150,10 @@ $(srcdir)/c-parse.y: c-parse.in
        $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
 
 c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
-    $(GGC_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
+    $(GGC_H) $(TARGET_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
     toplev.h intl.h $(TM_P_H)
 c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
-    flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
+    $(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
 c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
     $(GGC_H)  c-lex.h toplev.h diagnostic.h output.h function.h \
     $(RTL_H) $(EXPR_H)
@@ -1321,7 +1323,7 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
 convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h toplev.h
 
 tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
-   $(GGC_H) $(HASHTAB_H) output.h $(TM_P_H)
+   $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H)
 print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H)
 stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
    function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H)
@@ -1535,8 +1537,8 @@ params.o : params.c $(CONFIG_H) $(SYSTEM_H) params.h toplev.h
 
 $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
    $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
-   output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h \
-   function.h sched-int.h $(TM_P_H)
+   output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) \
+   $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H)
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
                $(out_file) $(OUTPUT_OPTION)
 
index 2c16afb97a3a446408b082174840504ad6db7fda..348701e78aee7000e7a7931fd9962587d29dfe21 100644 (file)
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "tm_p.h"
 #include "cpplib.h"
+#include "target.h"
 
 /* In grokdeclarator, distinguish syntactic contexts of declarators.  */
 enum decl_context
@@ -1403,7 +1404,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
 
   if (DECL_P (olddecl))
     DECL_MACHINE_ATTRIBUTES (newdecl)
-      = merge_machine_decl_attributes (olddecl, newdecl);
+      = (*target.merge_decl_attributes) (olddecl, newdecl);
 
   if (TREE_CODE (newtype) == ERROR_MARK
       || TREE_CODE (oldtype) == ERROR_MARK)
index cf995334b9af80c407cd75bae96893a4a8b8613f..1a9ed5fe06bc281be57ba1f493fc6fe47933f8ed 100644 (file)
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "intl.h"
 #include "ggc.h"
+#include "target.h"
 
 /* Nonzero if we've already printed a "missing braces around initializer"
    message within this initializer.  */
@@ -205,7 +206,7 @@ common_type (t1, t2)
     return t1;
 
   /* Merge the attributes.  */
-  attributes = merge_machine_type_attributes (t1, t2);
+  attributes = (*target.merge_type_attributes) (t1, t2);
 
   /* Treat an enum type as the unsigned integer type of the same width.  */
 
index 83c303b2b0b3e33d617911f1ed8512cb41eacf80..cdeecd29701c96c52451b9691724e5a6538048f2 100644 (file)
@@ -33,6 +33,8 @@ Boston, MA 02111-1307, USA.  */
 #include "regs.h"
 #include "output.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 struct datalabel_array datalbl[DATALBL_ARRSIZ];
 int datalbl_ndx = -1;
@@ -44,7 +46,11 @@ const char *const sectname[4] =
 {"Init", "Normal", "Konst", "Static"};
 
 static int which_bit PARAMS ((int));
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 void
 notice_update_cc (exp)
      rtx exp;
index 65c6240a3bc60f106e97cdcde34a479cee470aaa..3d6e85d52be2274d790192e2ea0053caf391d9e8 100644 (file)
@@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA.  */
 #include "tree.h"
 #include "reload.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 static int shift_constant_operand PARAMS ((rtx, enum machine_mode, int));
 static void a29k_set_memflags_1 PARAMS ((rtx, int, int, int, int));
@@ -90,6 +92,10 @@ int a29k_debug_reg_map[FIRST_PSEUDO_REGISTER];
 rtx a29k_compare_op0, a29k_compare_op1;
 int a29k_compare_fp_p;
 \f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Returns 1 if OP is a 8-bit constant. */
 
 int
index 79700d45f302d7958a300d5693e2b1e922c91df4..37a831352b765218ae8d545555c1f8d65dd6f0b2 100644 (file)
@@ -43,6 +43,8 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "tm_p.h"
 #include "integrate.h"
+#include "target.h"
+#include "target-def.h"
 
 /* External data.  */
 extern int rtx_equal_function_value_matters;
@@ -144,6 +146,10 @@ static rtx alpha_emit_xfloating_compare
 #define REG_PV 27
 #define REG_RA 26
 \f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Parse target option strings. */
 
 void
index 442a1bfa13d3fbc003d189377f1f8ab29a89d12b..e550e68a22546daba9991555f52867c1a81c00d0 100644 (file)
@@ -62,7 +62,6 @@ extern int shift_operator PARAMS ((rtx, enum machine_mode));
 extern enum arc_function_type arc_compute_function_type PARAMS ((tree));
 extern int arc_comp_type_attributes PARAMS ((tree, tree));
 extern void arc_set_default_type_attributes PARAMS ((tree));
-extern int arc_valid_machine_decl_attribute PARAMS ((tree, tree, tree, tree));
 extern void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
                                                enum machine_mode, tree,
                                                int *, int));
index 5c9acc603ca0af6ab1163ca1b1143f97dba24ca0..c5c910690c989a532142e60f86c268e295a93e18 100644 (file)
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "toplev.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Which cpu we're compiling for (NULL(=base), ???).  */
 const char *arc_cpu_string;
@@ -85,7 +87,14 @@ static int current_insn_set_cc_p;
 static void record_cc_ref PARAMS ((rtx));
 static void arc_init_reg_tables PARAMS ((void));
 static int get_arc_condition_code PARAMS ((rtx));
+static int arc_valid_decl_attribute PARAMS ((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE arc_valid_decl_attribute
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Called by OVERRIDE_OPTIONS to initialize various things.  */
 
 void
@@ -313,8 +322,8 @@ arc_init_reg_tables ()
 
 /* Return nonzero if IDENTIFIER is a valid decl attribute.  */
 
-int
-arc_valid_machine_decl_attribute (type, attributes, identifier, args)
+static int
+arc_valid_decl_attribute (type, attributes, identifier, args)
      tree type ATTRIBUTE_UNUSED;
      tree attributes ATTRIBUTE_UNUSED;
      tree identifier;
index 9026cf813fc058b7846d46ab595d274d130883eb..4a78213a58e4014fd92587c198bb4c31d6288384 100644 (file)
@@ -1575,12 +1575,6 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0)
 /* A function address in a call instruction.  */
 #define FUNCTION_MODE SImode
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-arc_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
 /* A C expression that returns zero if the attributes on TYPE1 and TYPE2 are
    incompatible, one if they are compatible, and two if they are
    nearly compatible (which causes a warning to be generated).  */
index 96af949e44ac1c7faa07fefe6589ea241033bbb9..2d3ee1a77d73be3f7fc972fbd038d6dc0f80629f 100644 (file)
@@ -38,9 +38,7 @@ extern unsigned long arm_current_func_type    PARAMS ((void));
 
 #ifdef TREE_CODE
 extern int    arm_return_in_memory     PARAMS ((tree));
-extern int    arm_valid_machine_decl_attribute PARAMS ((tree, tree, tree));
 extern int    arm_comp_type_attributes PARAMS ((tree, tree));
-extern int    arm_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
 extern void   arm_set_default_type_attributes  PARAMS ((tree));
 extern void   arm_encode_call_attribute        PARAMS ((tree, int));
 extern int    arm_function_ok_for_sibcall PARAMS ((tree));
@@ -187,10 +185,6 @@ extern int  arm_dllexport_name_p   PARAMS ((const char *));
 extern int  arm_dllimport_name_p       PARAMS ((const char *));
 
 #ifdef TREE_CODE
-extern int  arm_pe_valid_machine_decl_attribute
-                                       PARAMS ((tree, tree, tree, tree));
-extern tree arm_pe_merge_machine_decl_attributes
-                                       PARAMS ((tree, tree));
 extern void arm_pe_unique_section      PARAMS ((tree, int));
 extern void arm_pe_encode_section_info         PARAMS ((tree));
 extern int  arm_dllexport_p            PARAMS ((tree));
index c1f78873350e6768d903a19396af7938d87238a5..b673534525bbeccf7996851dd4b7088d316df949 100644 (file)
@@ -45,6 +45,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "integrate.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Forward definitions of types.  */
 typedef struct minipool_node    Mnode;
@@ -100,12 +102,34 @@ static int       current_file_function_operand    PARAMS ((rtx));
 static Ulong     arm_compute_save_reg_mask     PARAMS ((void));
 static Ulong     arm_isr_value                         PARAMS ((tree));
 static Ulong     arm_compute_func_type         PARAMS ((void));
-\f
+static int      arm_valid_type_attribute_p     PARAMS ((tree, tree,
+                                                        tree, tree));
+static int      arm_valid_decl_attribute_p     PARAMS ((tree, tree,
+                                                        tree, tree));
 #undef Hint
 #undef Mmode
 #undef Ulong
 #undef Ccstar
+\f
+/* Initialize the GCC target structure.  */
+#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
+#undef TARGET_MERGE_DECL_ATTRIBUTES
+#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes
+#endif
 
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE arm_valid_type_attribute_p
+
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#ifdef ARM_PE
+   static int arm_pe_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree));
+#  define TARGET_VALID_DECL_ATTRIBUTE arm_pe_valid_decl_attribute_p
+#else
+#  define TARGET_VALID_DECL_ATTRIBUTE arm_valid_decl_attribute_p
+#endif
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Obstack for minipool constant handling.  */
 static struct obstack minipool_obstack;
 static char *minipool_startobj;
@@ -1851,10 +1875,10 @@ arm_pr_long_calls_off (pfile)
 }
 
 \f
-/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
-   attribute for TYPE.  The attributes in ATTRIBUTES have previously been
-   assigned to TYPE.  */
-int
+/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine
+   specific attribute for TYPE.  The attributes in ATTRIBUTES have
+   previously been assigned to TYPE.  */
+static int
 arm_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
@@ -4093,9 +4117,10 @@ multi_register_push (op, mode)
      Always assume that this function will be entered in ARM mode,
      not Thumb mode, and that the caller wishes to be returned to in
      ARM mode.  */
-int
-arm_valid_machine_decl_attribute (decl, attr, args)
+static int
+arm_valid_decl_attribute_p (decl, attributes, attr, args)
      tree decl;
+     tree attributes ATTRIBUTE_UNUSED;
      tree attr;
      tree args;
 {
@@ -4118,6 +4143,39 @@ arm_valid_machine_decl_attribute (decl, attr, args)
   
   return 0;
 }
+
+#ifdef ARM_PE
+
+/* ARM/PE has three new attributes:
+   naked - for interrupt functions
+   dllexport - for exporting a function/variable that will live in a dll
+   dllimport - for importing a function/variable from a dll
+
+   Microsoft allows multiple declspecs in one __declspec, separating
+   them with spaces.  We do NOT support this.  Instead, use __declspec
+   multiple times.
+*/
+
+static int
+arm_pe_valid_decl_attribute_p (decl, attributes, attr, args)
+     tree decl;
+     tree attributes;
+     tree attr;
+     tree args;
+{
+  if (args != NULL_TREE)
+    return 0;
+
+  if (is_attribute_p ("dllexport", attr))
+    return 1;
+  
+  if (is_attribute_p ("dllimport", attr))
+    return 1;
+
+  return arm_valid_decl_attribute_p (decl, attributes, attr, args);
+}
+
+#endif /* ARM_PE  */
 \f
 /* Routines for use in generating RTL.  */
 rtx
index 2057ae67c2f6a8ba0894cfbc98b82e2fef68fd4a..88997d790667ccb33d03f81e02851365a72e068b 100644 (file)
@@ -2542,12 +2542,6 @@ extern const char * arm_pic_register_string;
    offset.  */
 extern int making_const_table;
 \f
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (arm_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* If defined, a C expression whose value is zero if the attributes on
    TYPE1 and TYPE2 are incompatible, one if they are compatible, and
    two if they are nearly compatible (which causes a warning to be
index 6265691e352b9a1121ec93dc120e33f5616db1d0..eeea20b2a9d3fcc185ca686bf77f2f39b208b28b 100644 (file)
@@ -41,12 +41,6 @@ Boston, MA 02111-1307, USA.  */
   { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
 #endif
 \f
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-  arm_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
-\f
 /* This is COFF, but prefer stabs.  */
 #define SDB_DEBUGGING_INFO
 
index 71fe99b2687ef61a2cb6a22f59cd908e15172689..2eb2388be8c7d41770580e64a03a5bf8e4b9de14 100644 (file)
@@ -190,12 +190,6 @@ Boston, MA 02111-1307, USA.  */
 #define MULTILIB_DEFAULTS \
   { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
 #endif
-
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-  arm_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
 \f
 
 /* This outputs a lot of .req's to define alias for various registers.
index 55b4668fc6a1fc78ef1ee50b05becbf22c5895d7..29c470e3f3c2dd6ddcfa94a51905f51db3d0472b 100644 (file)
@@ -31,93 +31,6 @@ Boston, MA 02111-1307, USA.  */
 
 extern int current_function_anonymous_args;
 
-/* ARM/PE specific attribute support.
-
-   ARM/PE has three new attributes:
-   naked - for interrupt functions
-   dllexport - for exporting a function/variable that will live in a dll
-   dllimport - for importing a function/variable from a dll
-
-   Microsoft allows multiple declspecs in one __declspec, separating
-   them with spaces.  We do NOT support this.  Instead, use __declspec
-   multiple times.
-*/
-
-/* Return nonzero if ATTR is a valid attribute for DECL.
-   ATTRIBUTES are any existing attributes and ARGS are the arguments
-   supplied with ATTR.  */
-
-int
-arm_pe_valid_machine_decl_attribute (decl, attributes, attr, args)
-     tree decl;
-     tree attributes ATTRIBUTE_UNUSED;
-     tree attr;
-     tree args;
-{
-  if (args != NULL_TREE)
-    return 0;
-
-  if (is_attribute_p ("dllexport", attr))
-    return 1;
-  
-  if (is_attribute_p ("dllimport", attr))
-    return 1;
-
-  return arm_valid_machine_decl_attribute (decl, attr, args);
-}
-
-/* Merge attributes in decls OLD and NEW.
-
-   This handles the following situation:
-
-   __declspec (dllimport) int foo;
-   int foo;
-
-   The second instance of `foo' nullifies the dllimport.  */
-
-tree
-arm_pe_merge_machine_decl_attributes (old, new)
-     tree old, new;
-{
-  tree a;
-  int delete_dllimport_p;
-
-  old = DECL_MACHINE_ATTRIBUTES (old);
-  new = DECL_MACHINE_ATTRIBUTES (new);
-
-  /* What we need to do here is remove from `old' dllimport if it doesn't
-     appear in `new'.  dllimport behaves like extern: if a declaration is
-     marked dllimport and a definition appears later, then the object
-     is not dllimport'd.  */
-
-  if (lookup_attribute ("dllimport", old) != NULL_TREE
-      && lookup_attribute ("dllimport", new) == NULL_TREE)
-    delete_dllimport_p = 1;
-  else
-    delete_dllimport_p = 0;
-
-  a = merge_attributes (old, new);
-
-  if (delete_dllimport_p)
-    {
-      tree prev,t;
-
-      /* Scan the list for dllimport and delete it.  */
-      for (prev = NULL_TREE, t = a; t; prev = t, t = TREE_CHAIN (t))
-       {
-         if (is_attribute_p ("dllimport", TREE_PURPOSE (t)))
-           {
-             if (prev == NULL_TREE)
-               a = TREE_CHAIN (a);
-             else
-               TREE_CHAIN (prev) = TREE_CHAIN (t);
-             break;
-           }
-       }
-    }
-
-  return a;
-}
 \f
 /* Return non-zero if DECL is a dllexport'd object.  */
 
index 8acd3e0783f3aab4c839f2b10b0468325db825bf..82818861c191807f604651dea6179723a732f77a 100644 (file)
@@ -38,6 +38,10 @@ Boston, MA 02111-1307, USA.  */
 #undef  TARGET_VERSION
 #define TARGET_VERSION fputs (" (ARM/pe)", stderr)
 
+/* Get tree.c to declare a target-specific specialization of
+   merge_decl_attributes.  */
+#define TARGET_DLLIMPORT_DECL_ATTRIBUTES
+
 /* Support the __declspec keyword by turning them into attributes.
    We currently only support: naked, dllimport, and dllexport.
    Note that the current way we do this may result in a collision with
@@ -91,16 +95,6 @@ Boston, MA 02111-1307, USA.  */
   1,1,1                        \
 }
 \f
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#undef  VALID_MACHINE_DECL_ATTRIBUTE
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-  arm_pe_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
-#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
-  arm_pe_merge_machine_decl_attributes ((OLD), (NEW))
-
 /* In addition to the stuff done in arm.h, we must mark dll symbols specially.
    Definitions of dllexport'd objects install some info in the .drectve
    section.  References to dllimport'd objects are fetched indirectly via
index c7f55397025b00634f53816700dd82092b1b35b0..3d99a313b9405c3ea2ce2e08cb974967c75bce12 100644 (file)
@@ -50,12 +50,6 @@ extern void   encode_section_info          PARAMS ((tree decl));
 extern void   asm_output_section_name      PARAMS ((FILE *file, tree decl,
                                                   const char *name,
                                                   int reloc));
-extern int    valid_machine_type_attribute PARAMS ((tree type, tree attributes,
-                                                  tree identifier,
-                                                  tree args));
-extern int    valid_machine_decl_attribute PARAMS ((tree decl, tree attributes,
-                                                  tree attr, tree args));
-
 extern int    avr_progmem_p                PARAMS ((tree decl));
 
 
index fe3df9490aa54fb9933ef151a467cbedf077b45a..7ca4ab788139c9e5bb10404ac27595e72467d6eb 100644 (file)
@@ -38,6 +38,8 @@
 #include "function.h"
 #include "recog.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Maximal allowed offset for an address in the LD command */
 #define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
@@ -56,6 +58,8 @@ static int    compare_sign_p       PARAMS ((rtx insn));
 static int    reg_was_0            PARAMS ((rtx insn, rtx op));
 static int    io_address_p         PARAMS ((rtx x, int size));
 void          debug_hard_reg_set   PARAMS ((HARD_REG_SET set));
+static int    avr_valid_type_attribute PARAMS ((tree, tree, tree, tree));
+static int    avr_valid_decl_attribute PARAMS ((tree, tree, tree, tree));
 
 /* Allocate registers from r25 to r8 for parameters for function calls */
 #define FIRST_CUM_REG 26
@@ -165,7 +169,16 @@ static const struct mcu_type_s avr_mcu_types[] = {
 };
 
 int avr_case_values_threshold = 30000;
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE avr_valid_decl_attribute
 
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE avr_valid_type_attribute
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 void
 avr_override_options ()
 {
@@ -4664,8 +4677,8 @@ class_likely_spilled_p (c)
 
 /* Only `progmem' attribute valid for type.  */
 
-int
-valid_machine_type_attribute(type, attributes, identifier, args)
+static int
+avr_valid_type_attribute (type, attributes, identifier, args)
      tree type ATTRIBUTE_UNUSED;
      tree attributes ATTRIBUTE_UNUSED;
      tree identifier;
@@ -4684,8 +4697,8 @@ valid_machine_type_attribute(type, attributes, identifier, args)
    prologue interrupts are enabled;
    naked     - don't generate function prologue/epilogue and `ret' command.  */
 
-int
-valid_machine_decl_attribute (decl, attributes, attr, args)
+static int
+avr_valid_decl_attribute (decl, attributes, attr, args)
      tree decl;
      tree attributes ATTRIBUTE_UNUSED;
      tree attr;
index 79c868928e655cbdd689d25cb780a382330d797c..25aeca3854846d6c2b2fe86fe104b58c876ace93 100644 (file)
@@ -2837,20 +2837,6 @@ extern int avr_case_values_threshold;
    of arguments that the function accepts.  Some people think a larger
    threshold should be used on RISC machines.  */
 
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-/* `VALID_MACHINE_DECL_ATTRIBUTE (DECL, ATTRIBUTES, IDENTIFIER, ARGS)'
-   If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
-     valid_machine_type_attribute(TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
-/* `VALID_MACHINE_TYPE_ATTRIBUTE (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)'
-   If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
 #define DOLLARS_IN_IDENTIFIERS 0
 /* Define this macro to control use of the character `$' in identifier
    names.  0 means `$' is not allowed by default; 1 means it is
index 14560451c9fef5443a3111198beb509e7fca00e6..27bbbdbb6e7fd1ab10e25601d6382c15b23e4ecb 100644 (file)
@@ -61,8 +61,6 @@ extern struct rtx_def *c4x_function_arg PARAMS ((CUMULATIVE_ARGS *,
 
 extern void c4x_encode_section_info PARAMS ((tree));
 
-extern int c4x_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
-
 #endif /* TREE_CODE */
 
 
index 9486fdce7febe6b649de42114556e64fc355407d..bf30de340bf1575b1666d5f3b17a25b4a6edc8b2 100644 (file)
@@ -47,6 +47,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-lex.h"
 #include "c-pragma.h"
 #include "c4x-protos.h"
+#include "target.h"
+#include "target-def.h"
 
 rtx smulhi3_libfunc;
 rtx umulhi3_libfunc;
@@ -187,7 +189,14 @@ static int c4x_parse_pragma PARAMS ((const char *, tree *, tree *));
 static int c4x_r11_set_p PARAMS ((rtx));
 static int c4x_rptb_valid_p PARAMS ((rtx, rtx));
 static int c4x_label_ref_used_p PARAMS ((rtx, rtx));
-
+static int c4x_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE c4x_valid_type_attribute_p
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Called to register all of our global variables with the garbage
    collector.  */
 
@@ -4741,7 +4750,7 @@ c4x_set_default_attributes(decl, attributes)
    specific attribute for TYPE.  The attributes in ATTRIBUTES have
    previously been assigned to TYPE.  */
 
-int
+static int
 c4x_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 49b903ee7d92c0b69938632dbea474d859f1212e..963752649d3f3f40dfa78a81c0441543c7213f3c 100644 (file)
@@ -2446,9 +2446,6 @@ do {                                              \
 #define SET_DEFAULT_DECL_ATTRIBUTES(DECL, ATTRIBUTES) \
   c4x_set_default_attributes (DECL, &ATTRIBUTES)
 
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (c4x_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* Assembler Commands for Alignment.  */
 
 #define ASM_OUTPUT_SKIP(FILE, SIZE) \
index 0c3f379569c394f4753f692f335f57850e45b86e..42a5ad7ff38756452245ce89549820d4af19aca5 100644 (file)
@@ -37,13 +37,19 @@ Boston, MA 02111-1307, USA.  */
 #include "flags.h"
 #include "recog.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 extern char regs_ever_live[];
 
 extern int frame_pointer_needed;
 
 static int frame_size;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Compute size of a clipper stack frame where 'lsize' is the required
    space for local variables.  */
 
index 947a715fccdc768c7e67b741401ee6007360b279..8589fb4c2dff9a0ecfe597f06db60ac8034b0a79 100644 (file)
@@ -33,6 +33,8 @@ Boston, MA 02111-1307, USA.  */
 #include "function.h"
 #include "expr.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Tables used in convex.h */
 
@@ -62,7 +64,11 @@ static int frame_argblock_size;
 static rtx convert_arg_pushes ();
 #endif
 static void expand_movstr_call PARAMS ((rtx *));
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Here from OVERRIDE_OPTIONS at startup.  Initialize constant tables. */
 
 void
index 8f8f6d20280b68860be4c8616c5afb3b44a0596d..c63dd528c1c962ca146959d7f0dbe0650a584233 100644 (file)
@@ -39,6 +39,8 @@
 #include "function.h"
 #include "toplev.h"
 #include "ggc.h"
+#include "target.h"
+#include "target-def.h"
 
 static void d30v_print_operand_memory_reference PARAMS ((FILE *, rtx));
 static void d30v_build_long_insn PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT,
@@ -76,7 +78,10 @@ enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
 
 /* Map class letter into register class */
 enum reg_class reg_class_from_letter[256];
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
index 3efa6d70fcedcf0fd112ddf377e67d62a024842c..f072cfb96f84fb62b072e43a4f50f00a3c48c81d 100644 (file)
@@ -5889,16 +5889,6 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
    must also be defined).  */
 /* #define HANDLE_WEAK_PRAGMA */
 
-/* If defined, a C expression whose value is nonzero if IDENTIFIER with
-   arguments ARGS is a valid machine specific attribute for DECL.  The
-   attributes in ATTRIBUTES have previously been assigned to DECL.  */
-/* #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) */
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER with
-   arguments ARGS is a valid machine specific attribute for TYPE.  The
-   attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-/* #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) */
-
 /* If defined, a C expression whose value is zero if the attributes on TYPE1
    and TYPE2 are incompatible, one if they are compatible, and two if they are
    nearly compatible (which causes a warning to be generated).  */
index fbc28c0d505559765d8f2b57ef7377b8633fa9ea..2a333ea06d65a7afdb4d0f65e839e9c34315141c 100644 (file)
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "recog.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 const char *text_seg_name;
 const char *rsect_text;
@@ -145,7 +147,11 @@ static const char *const lshift_right_asm_first[] =
 };
 
 static int reg_save_size PARAMS ((void));
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 int 
 hard_regno_mode_ok (regno, mode)
      int regno;
index ba1ea2774f07bdcb37222b0558cdefad9509e886..41b33631efa6fe17136e6299711f2c5be1b802b4 100644 (file)
@@ -27,6 +27,8 @@ Boston, MA 02111-1307, USA.  */
 #include "function.h"
 #include "output.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 extern const char *reg_names[];
 rtx cmp_op0=0, cmp_op1=0;
@@ -35,7 +37,11 @@ rtx cmp_op0=0, cmp_op1=0;
 static const char *const cmp_tab[] = {
     "gt", "gt", "eq", "eq", "ge", "ge", "lt", "lt", "ne", "ne",
     "le", "le" };
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* type is the index into the above table */
 /* s is "" for signed, or "u" for unsigned */
 const char *
index f1f63e1c324092f79dd13ee28dfa34ba03191ebf..51a5c26d49661c0721d58bb6f86e31a41a3258aa 100644 (file)
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA.  */
 #include "except.h"
 #include "function.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /*}}}*/
 /*{{{  Function Prologues & Epilogues */ 
@@ -136,7 +138,11 @@ static struct fr30_frame_info      zero_frame_info;
 #if UNITS_PER_WORD == 4
 #define WORD_ALIGN(SIZE) (((SIZE) + 3) & ~3)
 #endif
-     
+\f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Returns the number of bytes offset between FROM_REG and TO_REG
    for the current function.  As a side effect it fills in the 
    current_frame_info structure, if the data is available.  */
index 999dcf1ae5000d9240829d7b4a46f930d43eeffd..0c3aa2967e426923f835949b2e3af6b805f2aebe 100644 (file)
@@ -61,8 +61,6 @@ extern int nshift_operator PARAMS ((rtx, enum machine_mode));
 #ifdef TREE_CODE
 extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *,
                                             enum machine_mode, tree, int));
-extern int h8300_valid_machine_decl_attribute PARAMS ((tree, tree, tree,
-                                                      tree));
 extern int h8300_funcvec_function_p PARAMS ((tree));
 extern int h8300_eightbit_data_p PARAMS ((tree));
 extern int h8300_tiny_data_p PARAMS ((tree));
index f2bca7daa3b83942c8057b6e9516fc07fbd1404d..9fd2c3218fedd04202eb655d08ffe222f2086e84 100644 (file)
@@ -40,6 +40,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "tm_p.h"
 #include "ggc.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Forward declarations.  */
 static int h8300_interrupt_function_p PARAMS ((tree));
@@ -51,6 +53,7 @@ static unsigned int compute_saved_regs PARAMS ((void));
 static void push PARAMS ((FILE *, int));
 static void pop PARAMS ((FILE *, int));
 static const char *cond_string PARAMS ((enum rtx_code));
+static int h8300_valid_decl_attribute PARAMS ((tree, tree, tree, tree));
 
 /* CPU_TYPE, says what cpu we're compiling for.  */
 int cpu_type;
@@ -90,7 +93,13 @@ static const char *const h8_pop_ops[2] = { "pop", "pop.l" };
 static const char *const h8_mov_ops[2] = { "mov.w", "mov.l" };
 
 const char *h8_push_op, *h8_pop_op, *h8_mov_op;
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE h8300_valid_decl_attribute
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Initialize various cpu specific globals at start up.  */
 
 void
@@ -3022,8 +3031,8 @@ h8300_tiny_data_p (decl)
    tiny_data: This variable lives in the tiny data area and can be
    referenced with 16-bit absolute memory references.  */
 
-int
-h8300_valid_machine_decl_attribute (decl, attributes, attr, args)
+static int
+h8300_valid_decl_attribute (decl, attributes, attr, args)
      tree decl;
      tree attributes ATTRIBUTE_UNUSED;
      tree attr;
index d4d3fc1547e43ffeb0184f4d3e445265a855059c..47450e51d466cb5b02d799c6f45e3ce7dd18cda7 100644 (file)
@@ -998,12 +998,6 @@ struct cum_arg
    so give the MEM rtx a byte's mode.  */
 #define FUNCTION_MODE QImode
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
 #define ADJUST_INSN_LENGTH(INSN, LENGTH) \
   LENGTH += h8300_adjust_insn_length (INSN, LENGTH);
 
index 778930e5808088d2906d246a6cfc8d39e2ccf0b0..ebd1d85ef3a6efdc275acc507e5d97f39f4aba62 100644 (file)
@@ -41,6 +41,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "c-lex.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 extern FILE *asm_out_file;
 
@@ -283,7 +285,11 @@ static const unsigned char ebcasc[256] =
  /*F8   8     9                                     */
      0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF
 };
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Map characters from one character set to another.
    C is the character to be translated.  */
 
index a3d587fe600a59bb6640f3793020b8bb616e1d87..a1c7c332384623e28c7105c5c6258d5ee55186b8 100644 (file)
@@ -86,6 +86,10 @@ Boston, MA 02111-1307, USA. */
                       "-idirafter /usr/include/mingw"
 #endif
 
+/* Get tree.c to declare a target-specific specialization of
+   merge_decl_attributes.  */
+#define TARGET_DLLIMPORT_DECL_ATTRIBUTES
+
 /* Support the __declspec keyword by turning them into attributes.
    We currently only support: dllimport and dllexport.
    Note that the current way we do this may result in a collision with
@@ -199,11 +203,6 @@ extern int i386_pe_valid_decl_attribute_p PARAMS ((TREE, TREE, TREE, TREE));
   i386_pe_valid_type_attribute_p (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
 extern int i386_pe_valid_type_attribute_p PARAMS ((TREE, TREE, TREE, TREE));
 
-extern union tree_node *i386_pe_merge_decl_attributes PARAMS ((TREE, TREE));
-#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
-  i386_pe_merge_decl_attributes ((OLD), (NEW))
-extern TREE i386_pe_merge_decl_attributes PARAMS ((TREE, TREE));
-
 /* Used to implement dllexport overriding dllimport semantics.  It's also used
    to handle vtables - the first pass won't do anything because
    DECL_CONTEXT (DECL) will be 0 so i386_pe_dll{ex,im}port_p will return 0.
index 58d231336792353c27533db356aacaa5bd97a1be..88706c86865156879f385fd6ce118ceefaca95d1 100644 (file)
@@ -169,8 +169,6 @@ extern rtx ix86_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int))
 #endif
 
 #ifdef TREE_CODE
-extern int ix86_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree));
-extern int ix86_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
 extern int ix86_comp_type_attributes PARAMS ((tree, tree));
 extern int ix86_return_pops_args PARAMS ((tree, tree, int));
 
index 42cc2f7a1cf5ad99a60b12a36b7ed359e62a902f..21ceedc3b4528dcd09ef759b5a8ba5164c911b86 100644 (file)
@@ -40,6 +40,8 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "basic-block.h"
 #include "ggc.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifndef CHECK_STACK_LIMIT
 #define CHECK_STACK_LIMIT -1
@@ -605,6 +607,18 @@ static int ix86_fp_comparison_sahf_cost PARAMS ((enum rtx_code code));
 static int ix86_fp_comparison_cost PARAMS ((enum rtx_code code));
 static int ix86_save_reg PARAMS ((int, int));
 static void ix86_compute_frame_layout PARAMS ((struct ix86_frame *));
+static int ix86_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
+#undef TARGET_MERGE_DECL_ATTRIBUTES
+#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes
+#endif
+
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE ix86_valid_type_attribute_p
+
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
@@ -859,25 +873,11 @@ optimization_options (level, size)
 #endif
 }
 \f
-/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
-   attribute for DECL.  The attributes in ATTRIBUTES have previously been
-   assigned to DECL.  */
-
-int
-ix86_valid_decl_attribute_p (decl, attributes, identifier, args)
-     tree decl ATTRIBUTE_UNUSED;
-     tree attributes ATTRIBUTE_UNUSED;
-     tree identifier ATTRIBUTE_UNUSED;
-     tree args ATTRIBUTE_UNUSED;
-{
-  return 0;
-}
-
 /* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
    attribute for TYPE.  The attributes in ATTRIBUTES have previously been
    assigned to TYPE.  */
 
-int
+static int
 ix86_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 10556e63b94dcfef5a3e802dcf70ccaf858fa6b5..177e1321e370d53d16676548a4523ee3cb238405 100644 (file)
@@ -2240,20 +2240,6 @@ do                                                                       \
 while (0)
 
 \f
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
-  (ix86_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (ix86_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* If defined, a C expression whose value is zero if the attributes on
    TYPE1 and TYPE2 are incompatible, one if they are compatible, and
    two if they are nearly compatible (which causes a warning to be
index 39074cc1c6c8e642ee68d3f1d254abad9d4ddd48..676c4bddd5da2644a3ca41762275d3b0b8ad3eb2 100644 (file)
@@ -95,58 +95,6 @@ i386_pe_valid_type_attribute_p (type, attributes, attr, args)
   return ix86_valid_type_attribute_p (type, attributes, attr, args);
 }
 
-/* Merge attributes in decls OLD and NEW.
-
-   This handles the following situation:
-
-   __declspec (dllimport) int foo;
-   int foo;
-
-   The second instance of `foo' nullifies the dllimport.  */
-
-tree
-i386_pe_merge_decl_attributes (old, new)
-     tree old, new;
-{
-  tree a;
-  int delete_dllimport_p;
-
-  old = DECL_MACHINE_ATTRIBUTES (old);
-  new = DECL_MACHINE_ATTRIBUTES (new);
-
-  /* What we need to do here is remove from `old' dllimport if it doesn't
-     appear in `new'.  dllimport behaves like extern: if a declaration is
-     marked dllimport and a definition appears later, then the object
-     is not dllimport'd.  */
-
-  if (lookup_attribute ("dllimport", old) != NULL_TREE
-      && lookup_attribute ("dllimport", new) == NULL_TREE)
-    delete_dllimport_p = 1;
-  else
-    delete_dllimport_p = 0;
-
-  a = merge_attributes (old, new);
-
-  if (delete_dllimport_p)
-    {
-      tree prev,t;
-
-      /* Scan the list for dllimport and delete it.  */
-      for (prev = NULL_TREE, t = a; t; prev = t, t = TREE_CHAIN (t))
-       {
-         if (is_attribute_p ("dllimport", TREE_PURPOSE (t)))
-           {
-             if (prev == NULL_TREE)
-               a = TREE_CHAIN (a);
-             else
-               TREE_CHAIN (prev) = TREE_CHAIN (t);
-             break;
-           }
-       }
-    }
-
-  return a;
-}
 \f
 /* Return the type that we should use to determine if DECL is
    imported or exported.  */
index 5261b6969bc4503bc782b65d30a4dc677ddb67ee..08e099b2eb43b77a4cac1ba696b4aba646a5d49a 100644 (file)
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA.  */
 #include "function.h"
 #include "expr.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 static rtx find_addr_reg PARAMS ((rtx));
 static int reg_clobbered_p PARAMS ((rtx, rtx));
@@ -60,6 +62,10 @@ const char *i860_reg_prefix = I860_REG_PREFIX;
 
 rtx i860_compare_op0, i860_compare_op1;
 \f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Return non-zero if this pattern, can be evaluated safely, even if it
    was not asked for.  */
 int
index 0773c575a46160ed4b7c2914c948e6b6332a0c2d..fbdc939c0d0011fd3119999b02bb48ae31355d25 100644 (file)
@@ -44,6 +44,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "c-lex.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Save the operands last given to a compare for use when we
    generate a scc or bcc insn.  */
@@ -86,7 +88,11 @@ static int ret_label = 0;
 ((TYPE_ARG_TYPES (TREE_TYPE (FNDECL)) != 0                                                   \
   && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (FNDECL)))) != void_type_node))    \
  || current_function_varargs)
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Initialize variables before compiling any files.  */
 
 void
index a5c2848b3cf45646724e6e278fc8124a560c93f2..f0bae81e5cffcdc1c105609250029c193379bd80 100644 (file)
@@ -124,7 +124,6 @@ extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *,
 extern int ia64_return_in_memory PARAMS((tree));
 extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
 
-extern int ia64_valid_type_attribute PARAMS((tree, tree, tree, tree));
 extern void ia64_encode_section_info PARAMS((tree));
 #endif /* TREE_CODE */
 
index b85ce751ea7498523796174641f7aeabb09c0151..c503a673460e22632fd034a31f22b97ea2f0bca7 100644 (file)
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA.  */
 #include "basic-block.h"
 #include "toplev.h"
 #include "sched-int.h"
+#include "target.h"
+#include "target-def.h"
 
 /* This is used for communication between ASM_OUTPUT_LABEL and
    ASM_OUTPUT_LABELREF.  */
@@ -134,6 +136,13 @@ static rtx ia64_expand_compare_and_swap PARAMS ((enum machine_mode, int,
 static rtx ia64_expand_lock_test_and_set PARAMS ((enum machine_mode,
                                                  tree, rtx));
 static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx));
+static int ia64_valid_type_attribute PARAMS((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE ia64_valid_type_attribute
+
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Return 1 if OP is a valid operand for the MEM of a CALL insn.  */
 
@@ -6524,7 +6533,7 @@ ia64_epilogue_uses (regno)
 
 /* Return true if IDENTIFIER is a valid attribute for TYPE.  */
 
-int
+static int
 ia64_valid_type_attribute (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 20c40849affcc175e31ef369fc4915707210e905..cb2747e3571522f2f159b2bd6d92af650bac7cdb 100644 (file)
@@ -2756,13 +2756,6 @@ do {                                                                     \
 
 #define HANDLE_SYSV_PRAGMA
 
-/* If defined, a C expression whose value is nonzero if IDENTIFIER with
-   arguments ARGS is a valid machine specific attribute for TYPE.  The
-   attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
-  ia64_valid_type_attribute (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
-
 /* In rare cases, correct code generation requires extra machine dependent
    processing between the second jump optimization pass and delayed branch
    scheduling.  On those machines, define this macro as a C statement to act on
index f3eda8359d42498b5e073a71bd3fa71519e8e1d1..5ab4a4ce1a65f5ca2e531bdcb7986e55a94f3c5a 100644 (file)
@@ -36,7 +36,6 @@ extern void   m32r_asm_file_start             PARAMS ((FILE *));
 extern void   m32r_sched_init                  PARAMS ((FILE *, int));
 extern int    direct_return                    PARAMS ((void));
 #ifdef TREE_CODE
-extern int    m32r_valid_machine_decl_attribute        PARAMS ((tree, tree, tree, tree));
 extern int    m32r_comp_type_attributes                PARAMS ((tree, tree));
 extern void   m32r_select_section              PARAMS ((tree, int));
 extern void   m32r_encode_section_info         PARAMS ((tree));
index 5bb2d5691b6bad767102249d4dc3d27e8002fd1d..a7763a2c25c7b9bc58edd37503c5b47d7613ed03 100644 (file)
@@ -36,6 +36,8 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "ggc.h"
 #include "m32r-protos.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Save the operands last given to a compare for use when we
    generate a scc or bcc insn.  */
@@ -59,7 +61,15 @@ int m32r_sched_odd_word_p;
 static void  init_reg_tables                   PARAMS ((void));
 static void  block_move_call                   PARAMS ((rtx, rtx, rtx));
 static int   m32r_is_insn                      PARAMS ((rtx));
+static int   m32r_valid_decl_attribute         PARAMS ((tree, tree,
+                                                        tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE m32r_valid_decl_attribute
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Called by OVERRIDE_OPTIONS to initialize various things.  */
 
 void
@@ -242,8 +252,8 @@ init_idents PARAMS ((void))
 
 /* Return nonzero if IDENTIFIER is a valid decl attribute.  */
 
-int
-m32r_valid_machine_decl_attribute (type, attributes, identifier, args)
+static int
+m32r_valid_decl_attribute (type, attributes, identifier, args)
      tree type ATTRIBUTE_UNUSED;
      tree attributes ATTRIBUTE_UNUSED;
      tree identifier;
index 238160592e8f6faabdd36e5c459fc38b18ae5b48..8600e6ed7039bd6eb5d0b58c74c6c6d87bea5752 100644 (file)
@@ -2112,12 +2112,6 @@ extern char m32r_punct_chars[];
 /* A function address in a call instruction.  */
 #define FUNCTION_MODE SImode
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-m32r_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
 /* A C expression that returns zero if the attributes on TYPE1 and TYPE2 are
    incompatible, one if they are compatible, and two if they are
    nearly compatible (which causes a warning to be generated).  */
index 890bc205b657dc656bf6ea7d80b231bcc3666534..8c659b0571ea49be71499de4eff4b9d7fedc5ad4 100644 (file)
@@ -43,10 +43,6 @@ extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
                                                  enum machine_mode,
                                                  tree,
                                                  int));
-extern int m68hc11_valid_decl_attribute_p PARAMS((tree, tree,
-                                                 tree, tree));
-extern int m68hc11_valid_type_attribute_p PARAMS((tree, tree,
-                                                 tree, tree));
 extern int m68hc11_comp_type_attributes PARAMS((tree, tree));
 extern void m68hc11_set_default_type_attributes PARAMS((tree));
 extern void m68hc11_encode_section_info PARAMS((tree));
index fed8d16a1e3f19ac6f2c64b58a617dfcf5816f77..906c368f00aba757c08248c64f0de3f114686516 100644 (file)
@@ -52,6 +52,8 @@ Note:
 #include "basic-block.h"
 #include "function.h"
 #include "ggc.h"
+#include "target.h"
+#include "target-def.h"
 
 static void print_options PARAMS ((FILE *));
 static void emit_move_after_reload PARAMS ((rtx, rtx, rtx));
@@ -64,6 +66,8 @@ static rtx m68hc11_expand_compare PARAMS((enum rtx_code, rtx, rtx));
 static int must_parenthesize PARAMS ((rtx));
 static int m68hc11_shift_cost PARAMS ((enum machine_mode, rtx, int));
 static int m68hc11_auto_inc_p PARAMS ((rtx));
+static int m68hc11_valid_type_attribute_p PARAMS((tree, tree,
+                                                 tree, tree));
 
 void create_regs_rtx PARAMS ((void));
 
@@ -201,7 +205,13 @@ const char *m68hc11_soft_reg_count;
 static void m68hc11_add_gc_roots PARAMS ((void));
 
 static int nb_soft_regs;
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE m68hc11_valid_type_attribute_p
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 int
 m68hc11_override_options ()
 {
@@ -1115,25 +1125,11 @@ m68hc11_initialize_trampoline (tramp, fnaddr, cxt)
 \f
 /* Declaration of types.  */
 
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-int
-m68hc11_valid_decl_attribute_p (decl, attributes, identifier, args)
-     tree decl ATTRIBUTE_UNUSED;
-     tree attributes ATTRIBUTE_UNUSED;
-     tree identifier ATTRIBUTE_UNUSED;
-     tree args ATTRIBUTE_UNUSED;
-{
-  return 0;
-}
-
 /* If defined, a C expression whose value is nonzero if IDENTIFIER
    with arguments ARGS is a valid machine specific attribute for TYPE.
    The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
 
-int
+static int
 m68hc11_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 0e9a65b509407cfcbc0e5d9bfe33fa199f81fc8d..e9c38dea0b29ad1d3e319d4ad2e1c3708106cde3 100644 (file)
@@ -1194,21 +1194,6 @@ typedef struct m68hc11_args
   m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
 
 \f
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
-  (m68hc11_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (m68hc11_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* If defined, a C expression whose value is zero if the attributes on
    TYPE1 and TYPE2 are incompatible, one if they are compatible, and
    two if they are nearly compatible (which causes a warning to be
index 8bd26a7d82327a8894c3f263febded878fe03be5..e377e77c15efec964e107db9430383d33efb1462 100644 (file)
@@ -34,6 +34,8 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "toplev.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Needed for use_return_insn.  */
 #include "flags.h"
@@ -75,7 +77,11 @@ int m68k_align_funcs;
    sCC expanders peek at this to determine what to do for the
    68060, which has no fsCC instructions.  */
 int m68k_last_compare_had_fp_operands;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
index 2e788483166b393c042a78bf6fd9ab3e697cd068..38c6c66f437c63bf9b8899bd3a80fb14bfb59b93 100644 (file)
@@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "toplev.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 extern int flag_traditional;
 extern FILE *asm_out_file;
@@ -61,6 +63,10 @@ rtx m88k_compare_op1;                /* cmpsi operand 1 */
 
 enum processor_type m88k_cpu;  /* target cpu */
 \f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Determine what instructions are needed to manufacture the integer VALUE
    in the given MODE.  */
 
index 50af00819f4cf44f7809ba0cb0477bb829b909cd..8c2b1bac49b1ca077cd969db98a0ed6389419061 100644 (file)
@@ -37,8 +37,6 @@ extern int          mcore_naked_function_p            PARAMS ((void));
 #ifdef TREE_CODE
 extern void         mcore_unique_section               PARAMS ((tree, int));
 extern void         mcore_encode_section_info          PARAMS ((tree));
-extern int          mcore_valid_machine_decl_attribute PARAMS ((tree, tree, tree, tree));
-extern tree         mcore_merge_machine_decl_attributes PARAMS ((tree, tree));
 
 #ifdef HAVE_MACHINE_MODES
 extern int          mcore_function_arg_partial_nregs   PARAMS ((CUMULATIVE_ARGS, enum machine_mode, tree, int));
index 8fd64e5f765a55dc28fbb1736e909a192c7f7ae7..b7755091ce27db80b009598444efc0974ffac359 100644 (file)
@@ -39,6 +39,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "function.h"
 #include "ggc.h"
 #include "toplev.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Maximum size we are allowed to grow the stack in a single operation.
    If we want more, we must do it in increments of at most this size.
@@ -128,6 +130,19 @@ static void       mcore_mark_dllexport         PARAMS ((tree));
 static void       mcore_mark_dllimport         PARAMS ((tree));
 static int        mcore_dllexport_p            PARAMS ((tree));
 static int        mcore_dllimport_p            PARAMS ((tree));
+static int        mcore_valid_decl_attribute   PARAMS ((tree, tree,
+                                                       tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
+#undef TARGET_MERGE_DECL_ATTRIBUTES
+#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes
+#endif
+
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE mcore_valid_decl_attribute
+
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Adjust the stack and return the number of bytes taken to do it.  */
 static void
@@ -3496,8 +3511,8 @@ mcore_encode_section_info (decl)
    dllexport - for exporting a function/variable that will live in a dll
    dllimport - for importing a function/variable from a dll
    naked     - do not create a function prologue/epilogue.  */
-int
-mcore_valid_machine_decl_attribute (decl, attributes, attr, args)
+static int
+mcore_valid_decl_attribute (decl, attributes, attr, args)
      tree decl;
      tree attributes ATTRIBUTE_UNUSED;
      tree attr;
@@ -3537,57 +3552,6 @@ mcore_valid_machine_decl_attribute (decl, attributes, attr, args)
   return 0;
 }
 
-/* Merge attributes in decls OLD and NEW.
-   This handles the following situation:
-
-     __declspec (dllimport) int foo;
-     int foo;
-
-   The second instance of `foo' nullifies the dllimport.  */
-tree
-mcore_merge_machine_decl_attributes (old, new)
-     tree old;
-     tree new;
-{
-  tree a;
-  int delete_dllimport_p;
-
-  old = DECL_MACHINE_ATTRIBUTES (old);
-  new = DECL_MACHINE_ATTRIBUTES (new);
-
-  /* What we need to do here is remove from `old' dllimport if it doesn't
-     appear in `new'.  dllimport behaves like extern: if a declaration is
-     marked dllimport and a definition appears later, then the object
-     is not dllimport'd.  */
-  if (   lookup_attribute ("dllimport", old) != NULL_TREE
-      && lookup_attribute ("dllimport", new) == NULL_TREE)
-    delete_dllimport_p = 1;
-  else
-    delete_dllimport_p = 0;
-
-  a = merge_attributes (old, new);
-
-  if (delete_dllimport_p)
-    {
-      tree prev,t;
-
-      /* Scan the list for dllimport and delete it.  */
-      for (prev = NULL_TREE, t = a; t; prev = t, t = TREE_CHAIN (t))
-       {
-         if (is_attribute_p ("dllimport", TREE_PURPOSE (t)))
-           {
-             if (prev == NULL_TREE)
-               a = TREE_CHAIN (a);
-             else
-               TREE_CHAIN (prev) = TREE_CHAIN (t);
-             break;
-           }
-       }
-    }
-
-  return a;
-}
-
 /* Cover function for UNIQUE_SECTION.  */
 
 void
index ce1234ac393cdd65270c97ea75ab4d9ddbf3b78d..3440dbd6b99604e455f00c6431f9b11725950a4f 100644 (file)
@@ -35,15 +35,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Run-time Target Specification.  */
 #define TARGET_MCORE
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#undef  VALID_MACHINE_DECL_ATTRIBUTE
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-  mcore_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
-#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
-  mcore_merge_machine_decl_attributes (OLD, NEW)
+/* Get tree.c to declare a target-specific specialization of
+   merge_decl_attributes.  */
+#define TARGET_DLLIMPORT_DECL_ATTRIBUTES
 
 /* Support the __declspec keyword by turning them into attributes.
    We currently only support: dllexport and dllimport.
index 05edaff82aeb6450c8fb7a13c805eeaf0ce79f20..dd735cc25c1ac540053b18901c806efb3bb19aa1 100644 (file)
@@ -49,8 +49,9 @@ Boston, MA 02111-1307, USA.  */
 #include "output.h"
 #include "tm_p.h"
 #include "ggc.h"
-
 #include "gstab.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifdef __GNU_STAB__
 #define STAB_CODE_TYPE enum __stab_debug_code
@@ -427,7 +428,10 @@ enum reg_class mips_char_to_class[256] =
   NO_REGS,     NO_REGS,        NO_REGS,        NO_REGS,
   NO_REGS,     NO_REGS,        NO_REGS,        NO_REGS,
 };
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Return truth value of whether OP can be used as an operands
    where a register or 16 bit unsigned integer is needed.  */
index 1a4f9dd0f030826eb7d8c4d92152160b637ba10a..965d61c81d0c804ed234a359d81b14f5d18015c0 100644 (file)
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "toplev.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Global registers known to hold the value zero.
 
@@ -63,7 +65,11 @@ static void count_tst_insns PARAMS ((int *));
 
 /* Note whether or not we need an out of line epilogue.  */
 static int out_of_line_epilogue;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Indicate this file was compiled by gcc and what optimization
    level was used.  */
 void
index ee408d4e0987bd702efc1babfce9d0b2732d7ad1..472b2933fba9521b53d88aa5f7bd8a4ebfa69c49 100644 (file)
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include "toplev.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* The size of the callee register save area.  Right now we save everything
    on entry since it costs us nothing in code size.  It does cost us from a
@@ -48,7 +50,11 @@ Boston, MA 02111-1307, USA.  */
                        + 4 * regs_ever_live[7] \
                        + 16 * (regs_ever_live[14] || regs_ever_live[15] \
                                || regs_ever_live[16] || regs_ever_live[17]))
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 void
 asm_file_start (file)
      FILE *file;
index 496d0862e09b24183b6dde501e2366fdd7352fda..7c6da1bbca00f82cdc30a3f6bc630feb99d0dd9c 100644 (file)
@@ -40,8 +40,6 @@ extern int symbolic_reference_mentioned_p PARAMS ((rtx));
 #ifdef TREE_CODE
 extern int ns32k_comp_type_attributes PARAMS ((tree, tree));
 extern int ns32k_return_pops_args PARAMS ((tree, tree, int));
-extern int ns32k_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree));
-extern int ns32k_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
 #endif /* TREE_CODE */
 
 extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
index 3fbde5a8f16b7af15a90bae26c27f70c1e155646..ec5470a05c23cb0ddcef9820ac79a5ceb7664bca 100644 (file)
@@ -35,6 +35,8 @@ Boston, MA 02111-1307, USA.  */
 #include "flags.h"
 #include "recog.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifdef OSF_OS
 int ns32k_num_files = 0;
@@ -62,7 +64,14 @@ const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES;
 static rtx gen_indexed_expr PARAMS ((rtx, rtx, rtx));
 static const char *singlemove_string PARAMS ((rtx *));
 static void move_tail PARAMS ((rtx[], int, int));
+static int ns32k_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE ns32k_valid_type_attribute_p
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ 
 int
 hard_regno_mode_ok (regno, mode)
@@ -633,25 +642,11 @@ symbolic_reference_mentioned_p (op)
   return 0;
 }
 \f
-/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
-   attribute for DECL.  The attributes in ATTRIBUTES have previously been
-   assigned to DECL.  */
-
-int
-ns32k_valid_decl_attribute_p (decl, attributes, identifier, args)
-     tree decl ATTRIBUTE_UNUSED;
-     tree attributes ATTRIBUTE_UNUSED;
-     tree identifier ATTRIBUTE_UNUSED;
-     tree args ATTRIBUTE_UNUSED;
-{
-  return 0;
-}
-
 /* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
    attribute for TYPE.  The attributes in ATTRIBUTES have previously been
    assigned to TYPE.  */
 
-int
+static int
 ns32k_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 9a377b5a9016dd7b620087db95d4835863ba4ada..e92140b797334b451ce28c3329670be86c56f8bc 100644 (file)
@@ -1294,20 +1294,6 @@ while (0)
  { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC)      \
      goto LABEL;}
 \f
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
-  (ns32k_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (ns32k_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* If defined, a C expression whose value is zero if the attributes on
    TYPE1 and TYPE2 are incompatible, one if they are compatible, and
    two if they are nearly compatible (which causes a warning to be
index 2b7b17d8b2eb8153476e611d0ca9fcf0ec71a855..9100a80fa327b6a70b2ccd530243a98b8ba4b041 100644 (file)
@@ -41,6 +41,8 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "recog.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifndef DO_FRAME_NOTES
 #ifdef INCOMING_RETURN_ADDR_RTX
@@ -105,7 +107,11 @@ struct deferred_plabel
   char *name;
 } *deferred_plabels = 0;
 int n_deferred_plabels = 0;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 void
 override_options ()
 {
index b298ea0ebffd6eb004d4dcd30a1e5fca57b91022..6da1531d13b8e69347da540efa9da80e20b64f4d 100644 (file)
@@ -35,6 +35,8 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "tree.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /*
 #define FPU_REG_P(X)   ((X)>=8 && (X)<14)
@@ -50,7 +52,11 @@ int current_first_parm_offset;
 
 static rtx find_addr_reg PARAMS ((rtx)); 
 static const char *singlemove_string PARAMS ((rtx *)); 
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Nonzero if OP is a valid second operand for an arithmetic insn.  */
 
 int
index febe2997bcfb9c9be65d9028b9cdaf9f419c7cd4..1e0d3a828dd69a060ceebe93c165133be373129a 100644 (file)
@@ -99,6 +99,8 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "basic-block.h"
 #include "ggc.h"
+#include "target.h"
+#include "target-def.h"
 
 /* Compare insns in pj.md store the information needed to generate
    branch instructions here.  */
@@ -122,7 +124,11 @@ static int nfakes;
 /* Whether anything has been printed to the current assembly output
    line. */
 int pj_stuff_on_line;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* printf to the asm_out_file, with special format control characters
    for decoding operands.  
 
index 8cabb46e825cf57eb86964fb339b31b13652ef6e..aec840ca44c22f48ffc5636999303e45b9392c72 100644 (file)
@@ -38,6 +38,8 @@ Boston, MA 02111-1307, USA.  */
 #include "tree.h"
 #include "function.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 #define min(A,B)       ((A) < (B) ? (A) : (B))
 #define max(A,B)       ((A) > (B) ? (A) : (B))
@@ -49,6 +51,10 @@ static void init_fpops PARAMS ((void));
 static int memory_offset_in_range_p PARAMS ((rtx, enum machine_mode, int, int));
 static unsigned int hash_rtx PARAMS ((rtx));
 \f
+/* Initialize the GCC target structure.  */
+
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Return 1 if the insn using CC0 set by INSN does not contain
    any unsigned tests applied to the condition codes.
 
index 6307503507932520d1bc42e5df219554726c105c..cbcd25746336930d71673708f88e6a2ec50fc0bb 100644 (file)
@@ -138,8 +138,6 @@ extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
 extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree));
 extern void output_mi_thunk PARAMS ((FILE *, tree, int, tree));
 extern int rs6000_comp_type_attributes PARAMS ((tree, tree));
-extern int rs6000_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree));
-extern int rs6000_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
 extern void rs6000_set_default_type_attributes PARAMS ((tree));
 extern void rs6000_encode_section_info PARAMS ((tree));
 extern void rs6000_select_section PARAMS ((tree, int));
index 2267b06c3338525bb331cfac9466247546705b77..45e6bd40d0643def4fff5ce8ff218e70157815dc 100644 (file)
@@ -42,6 +42,8 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "hashtab.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifndef TARGET_NO_PROTOTYPE
 #define TARGET_NO_PROTOTYPE 0
@@ -123,6 +125,7 @@ static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
 static void rs6000_free_machine_status PARAMS ((struct function *));
 static void rs6000_init_machine_status PARAMS ((struct function *));
 static int rs6000_ra_ever_killed PARAMS ((void));
+static int rs6000_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
 \f
 /* Default register names.  */
 char rs6000_reg_names[][8] =
@@ -160,7 +163,13 @@ static char alt_reg_names[][8] =
 #ifndef MASK_STRICT_ALIGN
 #define MASK_STRICT_ALIGN 0
 #endif
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE rs6000_valid_type_attribute_p
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Override command line options.  Mostly we process the processor
    type and sometimes adjust other TARGET_ options.  */
 
@@ -7820,25 +7829,11 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
 }
 
 \f
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-int
-rs6000_valid_decl_attribute_p (decl, attributes, identifier, args)
-     tree decl ATTRIBUTE_UNUSED;
-     tree attributes ATTRIBUTE_UNUSED;
-     tree identifier ATTRIBUTE_UNUSED;
-     tree args ATTRIBUTE_UNUSED;
-{
-  return 0;
-}
-
 /* If defined, a C expression whose value is nonzero if IDENTIFIER
    with arguments ARGS is a valid machine specific attribute for TYPE.
    The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
 
-int
+static int
 rs6000_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
      tree attributes ATTRIBUTE_UNUSED;
index 230cdc8c941b469412300ead5aef4ff523c6fd9c..ad4768fdab8ec9d9047bb4d9990126c7546f5e4e 100644 (file)
@@ -1611,20 +1611,6 @@ typedef struct rs6000_args
 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT)               \
   rs6000_initialize_trampoline (ADDR, FNADDR, CXT)
 \f
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
-  (rs6000_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
-
-/* If defined, a C expression whose value is nonzero if IDENTIFIER
-   with arguments ARGS is a valid machine specific attribute for TYPE.
-   The attributes in ATTRIBUTES have previously been assigned to TYPE.  */
-
-#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
-  (rs6000_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))
-
 /* If defined, a C expression whose value is zero if the attributes on
    TYPE1 and TYPE2 are incompatible, one if they are compatible, and
    two if they are nearly compatible (which causes a warning to be
index fa4f7d132dd74023f50b70e9e754e9804cae90e4..2296e414bd85891641aa111c60d1d3657530d14b 100644 (file)
@@ -106,7 +106,6 @@ extern rtx sh_va_arg PARAMS ((tree, tree));
 
 #ifdef TREE_CODE
 extern void sh_pragma_insert_attributes PARAMS ((tree, tree *, tree *));
-extern int sh_valid_machine_decl_attribute PARAMS ((tree, tree, tree, tree));
 extern tree sh_build_va_list PARAMS ((void));
 #endif /* TREE_CODE */
 
index db7ec5f60e206ab07226513d4789eff7373a30bb..5cdc2093d79749993296e4b8ee24149f86769b23 100644 (file)
@@ -37,6 +37,8 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "c-pragma.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
 
@@ -151,6 +153,13 @@ static int calc_live_regs PARAMS ((int *, int *));
 static void mark_use PARAMS ((rtx, rtx *));
 static HOST_WIDE_INT rounded_frame_size PARAMS ((int));
 static rtx mark_constant_pool_use PARAMS ((rtx));
+static int sh_valid_decl_attribute PARAMS ((tree, tree, tree, tree));
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE sh_valid_decl_attribute
+
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Print the operand address in x to the stream.  */
 
@@ -4626,8 +4635,8 @@ sh_pragma_insert_attributes (node, attributes, prefix)
    trap_exit -- use a trapa to exit an interrupt function instead of
    an rte instruction.  */
 
-int
-sh_valid_machine_decl_attribute (decl, attributes, attr, args)
+static int
+sh_valid_decl_attribute (decl, attributes, attr, args)
      tree decl;
      tree attributes ATTRIBUTE_UNUSED;
      tree attr;
index 0707977bcf9363caaf4661688944c058199c4476..0b36079560de4835ca1c6ab6d353598ad822101d 100644 (file)
@@ -2298,12 +2298,6 @@ extern int current_function_interrupt;
    for interrupt functions.  */
 extern struct rtx_def *sp_switch;
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-sh_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-
 #define PRAGMA_INSERT_ATTRIBUTES(node, pattr, prefix_attr) \
   sh_pragma_insert_attributes (node, pattr, prefix_attr)
 
index 0d5b3635e86e6209720b2943e70588bd395815f2..ab24f0d8f1b4dcd04cd9606f46236772469d5b7f 100644 (file)
@@ -40,6 +40,8 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "ggc.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 /* 1 if the caller has placed an "unimp" insn immediately after the call.
    This is used in v8 code when calling a function that returns a structure.
@@ -175,7 +177,11 @@ struct sparc_cpu_select sparc_select[] =
 
 /* CPU type.  This is set from TARGET_CPU_DEFAULT and -m{cpu,tune}=xxx.  */
 enum processor_type sparc_cpu;
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* Validate and override various options, and do some machine dependent
    initialization.  */
 
index cc52b0c33e0ec76ea5fe3506d95cb512b72e7dea..9d6d08adc226c08a89ceb44045da2860f98b3175 100644 (file)
@@ -72,7 +72,6 @@ extern rtx    v850_va_arg                   PARAMS ((tree, tree));
 #endif /* TREE_CODE */
 
 #ifdef TREE_CODE
-extern int    v850_valid_machine_decl_attribute  PARAMS ((tree, tree, tree));
 extern void   v850_encode_data_area         PARAMS ((tree));
 extern void   v850_set_default_decl_attr    PARAMS ((tree));
 extern int    v850_interrupt_function_p     PARAMS ((tree));
index 4883ab2daaebe7a61cfa4708247f9fa9062b26b1..18ad632eed063bb9f3706522fe8e6fc659b6c624 100644 (file)
@@ -40,6 +40,8 @@ Boston, MA 02111-1307, USA.  */
 #include "c-lex.h"
 #include "ggc.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
 
 #ifndef streq
 #define streq(a,b) (strcmp (a, b) == 0)
@@ -51,6 +53,7 @@ static int  const_costs_int          PARAMS ((HOST_WIDE_INT, int));
 static void substitute_ep_register   PARAMS ((rtx, rtx, int, int, rtx *, rtx *));
 static int  ep_memory_offset         PARAMS ((enum machine_mode, int));
 static void v850_set_data_area       PARAMS ((tree, v850_data_area));
+static int v850_valid_decl_attribute PARAMS ((tree, tree, tree, tree));
 
 /* True if the current function has anonymous arguments.  */
 int current_function_anonymous_args;
@@ -78,7 +81,12 @@ static int v850_interrupt_cache_p = FALSE;
 
 /* Whether current function is an interrupt handler.  */
 static int v850_interrupt_p = FALSE;
+\f
+/* Initialize the GCC target structure.  */
+#undef TARGET_VALID_DECL_ATTRIBUTE
+#define TARGET_VALID_DECL_ATTRIBUTE v850_valid_decl_attribute
 
+struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
@@ -2003,9 +2011,10 @@ v850_set_data_area (decl, data_area)
 /* Return nonzero if ATTR is a valid attribute for DECL.
    ARGS are the arguments supplied with ATTR.  */
 
-int
-v850_valid_machine_decl_attribute (decl, attr, args)
+static int
+v850_valid_decl_attribute (decl, unused, attr, args)
      tree decl;
+     tree unused ATTRIBUTE_UNUSED;
      tree attr;
      tree args;
 {
index 9b348c7aab49c5c40afaa916281f6c69a080d183..bde4bb360512b510ee14fb2a72d45d72e8422eef 100644 (file)
@@ -1486,12 +1486,6 @@ do { char dstr[30];                                      \
    so give the MEM rtx a byte's mode.  */
 #define FUNCTION_MODE QImode
 
-/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-   is a valid machine specific attribute for DECL.
-   The attributes in ATTRIBUTES have previously been assigned to DECL.  */
-#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-  v850_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
-
 /* A C statement that assigns default attributes to a newly created DECL.  */
 #define SET_DEFAULT_DECL_ATTRIBUTES(decl, attr) \
      v850_set_default_decl_attr (decl)
index 574ffa525c4d9d387f623d9bef8c9e0dcbcf4f1e..43d6a9cc7bdfc926b955b8a1ee6ba9861a0e6a63 100644 (file)
@@ -34,7 +34,13 @@ Boston, MA 02111-1307, USA.  */
 #include "tree.h"
 #endif
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 /* This is like nonimmediate_operand with a restriction on the type of MEM.  */
 
 void
index 6d5c00a9dfe36f3c60389557cebfa585e2917bac..f7346a49a9e8332fed60f5cfcf0d843b46f66cfe 100644 (file)
@@ -30,7 +30,13 @@ Boston, MA 02111-1307, USA.  */
 #include "recog.h"
 #include "output.h"
 #include "tm_p.h"
+#include "target.h"
+#include "target-def.h"
+\f
+/* Initialize the GCC target structure.  */
 
+struct gcc_target target = TARGET_INITIALIZER;
+\f
 void
 output_move_double (operands)
      rtx *operands;
index 9965c5e737e432f78bbf28563d9749874181dc7e..07a2e5bede5534584dc22b88e3557dae12453f5f 100644 (file)
@@ -233,7 +233,7 @@ c++.stage4: stage4-start
 #\f
 # .o: .h dependencies.
 CXX_TREE_H = $(TREE_H) cp/cp-tree.h c-common.h cp/cp-tree.def c-common.def \
-       function.h varray.h $(SYSTEM_H) $(CONFIG_H) \
+       function.h varray.h $(SYSTEM_H) $(CONFIG_H) $(TARGET_H) \
        $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h
 
 cp/spew.o: cp/spew.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h toplev.h
index 0968220b2fd0812ece312d60caa99944065a3487..350422bcfe6c59fb8914616397102e04f675821d 100644 (file)
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA.  */
 #include "../hash.h"
 #include "ggc.h"
 #include "tm_p.h"
+#include "target.h"
 
 extern int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree));
 
@@ -3483,7 +3484,7 @@ duplicate_decls (newdecl, olddecl)
   /* Copy all the DECL_... slots specified in the new decl
      except for any that we copy here from the old type.  */
   DECL_MACHINE_ATTRIBUTES (newdecl)
-    = merge_machine_decl_attributes (olddecl, newdecl);
+    = (*target.merge_decl_attributes) (olddecl, newdecl);
 
   if (TREE_CODE (newdecl) == TEMPLATE_DECL)
     {
index 56c4dbc0c0fac50a61965d9251006e3e545943ec..7d0ee46c639d8a81a3022abee4e6f524c6456f73 100644 (file)
@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "timevar.h"
 #include "cpplib.h"
+#include "target.h"
 extern cpp_reader *parse_in;
 
 /* This structure contains information about the initializations
@@ -2455,13 +2456,15 @@ import_export_class (ctype)
   if (CLASSTYPE_INTERFACE_ONLY (ctype))
     return;
 
-#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
-  /* FIXME this should really use some sort of target-independent macro.  */
-  if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
-    import_export = -1;
-  else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
-    import_export = 1;
-#endif
+  if (target.valid_type_attribute != NULL)
+    {
+      /* FIXME this should really use some sort of target-independent
+         macro.  */
+      if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
+       import_export = -1;
+      else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
+       import_export = 1;
+    }
 
   /* If we got -fno-implicit-templates, we import template classes that
      weren't explicitly instantiated.  */
index 1256b6d1ca138ce150cd8c777e73619c44793ba2..db1044adeee688cc4b45d6c9d43421ea1ff97c85 100644 (file)
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA.  */
 #include "output.h"
 #include "toplev.h"
 #include "diagnostic.h"
+#include "target.h"
 
 static tree convert_for_assignment PARAMS ((tree, tree, const char *, tree,
                                          int));
@@ -210,8 +211,8 @@ qualify_type_recursive (t1, t2)
       tree tt2 = TREE_TYPE (t2);
       tree b1;
       int type_quals;
-      tree target;
-      tree attributes = merge_machine_type_attributes (t1, t2);
+      tree tgt;
+      tree attributes = (*target.merge_type_attributes) (t1, t2);
 
       if (TREE_CODE (tt1) == OFFSET_TYPE)
        {
@@ -223,11 +224,11 @@ qualify_type_recursive (t1, t2)
        b1 = NULL_TREE;
 
       type_quals = (CP_TYPE_QUALS (tt1) | CP_TYPE_QUALS (tt2));
-      target = qualify_type_recursive (tt1, tt2);
-      target = cp_build_qualified_type (target, type_quals);
+      tgt = qualify_type_recursive (tt1, tt2);
+      tgt = cp_build_qualified_type (tgt, type_quals);
       if (b1)
-       target = build_offset_type (b1, target);
-      t1 = build_pointer_type (target);
+       tgt = build_offset_type (b1, tgt);
+      t1 = build_pointer_type (tgt);
       t1 = build_type_attribute_variant (t1, attributes);
     }
   return t1;
@@ -342,7 +343,7 @@ type_after_usual_arithmetic_conversions (t1, t2)
 
   /* In what follows, we slightly generalize the rules given in [expr]
      so as to deal with `long long'.  First, merge the attributes.  */
-  attributes = merge_machine_type_attributes (t1, t2);
+  attributes = (*target.merge_type_attributes) (t1, t2);
 
   /* If only one is real, use it as the result.  */
   if (code1 == REAL_TYPE && code2 != REAL_TYPE)
@@ -548,7 +549,7 @@ common_type (t1, t2)
     return type_after_usual_arithmetic_conversions (t1, t2);
 
   /* Merge the attributes.  */
-  attributes = merge_machine_type_attributes (t1, t2);
+  attributes = (*target.merge_type_attributes) (t1, t2);
 
   /* Treat an enum type as the unsigned integer type of the same width.  */
 
index 9c706102e8e36b32235251c28fc1407ea2478c96..40c28e383fcd42089feb76e9219d2b8d5690717c 100644 (file)
@@ -272,7 +272,7 @@ bugs.  It corresponds to GCC version 3.1.
 * Trees::           The source representation used by the C and C++ front ends.
 * RTL::             The intermediate representation that most passes work on.
 * Machine Desc::    How to write machine description instruction patterns.
-* Target Macros::   How to write the machine description C macros.
+* Target Macros::   How to write the machine description C macros and functions.
 * Config::          Writing the @file{xm-@var{machine}.h} file.
 * Fragments::       Writing the @file{t-@var{target}} and @file{x-@var{host}} files.
 @end ifset
index 1b1c5663e0b20e13d987bbfa15388f5e3a5ad6d9..24eed3aefecbe430173c8c1f9e119bd94a554265 100644 (file)
@@ -4,7 +4,7 @@
 @c For copying conditions, see the file gcc.texi.
 
 @node Target Macros
-@chapter Target Description Macros
+@chapter Target Description Macros and Functions
 @cindex machine description macros
 @cindex target description macros
 @cindex macros, target description
 
 In addition to the file @file{@var{machine}.md}, a machine description
 includes a C header file conventionally given the name
-@file{@var{machine}.h}.  This header file defines numerous macros
-that convey the information about the target machine that does not fit
-into the scheme of the @file{.md} file.  The file @file{tm.h} should be
-a link to @file{@var{machine}.h}.  The header file @file{config.h}
-includes @file{tm.h} and most compiler source files include
-@file{config.h}.
+@file{@var{machine}.h} and a C source file named @file{@var{machine}.c}.
+The header file defines numerous macros that convey the information
+about the target machine that does not fit into the scheme of the
+@file{.md} file.  The file @file{tm.h} should be a link to
+@file{@var{machine}.h}.  The header file @file{config.h} includes
+@file{tm.h} and most compiler source files include @file{config.h}.  The
+source file defines a variable @code{target}, which is a structure
+containing pointers to functions and data relating to the target
+machine.  @file{@var{machine}.c} should also contain their definitions,
+if they are not defined elsewhere in GCC, and other functions called
+through the macros defined in the @file{.h} file.
 
 @menu
+* Target Structure::    The @code{target} variable.
 * Driver::              Controlling how the driver runs the compilation passes.
 * Run-time Target::     Defining @samp{-m} options like @option{-m68000} and @option{-m68020}.
 * Per-Function Data::   Defining data structures for per-function information.
@@ -44,6 +50,38 @@ includes @file{tm.h} and most compiler source files include
 * Misc::                Everything else.
 @end menu
 
+@node Target Structure
+@section The Global @code{target} Variable
+@cindex target hooks
+@cindex target functions
+
+@deftypevar {struct gcc_target} target
+The target @file{.c} file must define the global @code{target} variable
+which contains pointers to functions and data relating to the target
+machine.  The variable is declared in @file{target.h};
+@file{target-def.h} defines the macro @code{TARGET_INITIALIZER} which is
+used to initialize the variable, and macros for the default initializers
+for elements of the structure.  The @file{.c} file should override those
+macros for which the default definition is inappropriate.  For example:
+@smallexample
+#include "target.h"
+#include "target-def.h"
+
+/* @r{Initialize the GCC target structure.}  */
+
+#undef TARGET_VALID_TYPE_ATTRIBUTE
+#define TARGET_VALID_TYPE_ATTRIBUTE @var{machine}_valid_type_attribute_p
+
+struct gcc_target target = TARGET_INITIALIZER;
+@end smallexample
+@end deftypevar
+
+Where a macro should be defined in the @file{.c} file in this manner to
+form part of the @code{target} structure, it is documented below as a
+``Target Hook'' with a prototype.  Many macros will change in future
+from being defined in the @file{.h} file to being part of the
+@code{target} structure.
+
 @node Driver
 @section Controlling the Compilation Driver, @file{gcc}
 @cindex driver
@@ -8223,19 +8261,21 @@ pack value of zero resets the behaviour to the default.  Successive
 invocations of this pragma cause the previous values to be stacked, so
 that invocations of @samp{#pragma pack(pop)} will return to the previous
 value.
+@end table
 
-@findex VALID_MACHINE_DECL_ATTRIBUTE
-@item VALID_MACHINE_DECL_ATTRIBUTE (@var{decl}, @var{attributes}, @var{identifier}, @var{args})
-If defined, a C expression whose value is nonzero if @var{identifier} with
+@deftypefn {Target Hook} int TARGET_VALID_DECL_ATTRIBUTE (tree @var{decl}, tree @var{attributes}, tree @var{identifier}, tree @var{args})
+If defined, this target hook is a function which returns nonzero if @var{identifier} with
 arguments @var{args} is a valid machine specific attribute for @var{decl}.
 The attributes in @var{attributes} have previously been assigned to @var{decl}.
+@end deftypefn
 
-@findex VALID_MACHINE_TYPE_ATTRIBUTE
-@item VALID_MACHINE_TYPE_ATTRIBUTE (@var{type}, @var{attributes}, @var{identifier}, @var{args})
-If defined, a C expression whose value is nonzero if @var{identifier} with
+@deftypefn {Target Hook} int TARGET_VALID_TYPE_ATTRIBUTE (tree @var{type}, tree @var{attributes}, tree @var{identifier}, tree @var{args})
+If defined, this target hook is a function which returns nonzero if @var{identifier} with
 arguments @var{args} is a valid machine specific attribute for @var{type}.
 The attributes in @var{attributes} have previously been assigned to @var{type}.
+@end deftypefn
 
+@table @code
 @findex COMP_TYPE_ATTRIBUTES
 @item COMP_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
 If defined, a C expression whose value is zero if the attributes on
@@ -8247,23 +8287,36 @@ generated).
 @item SET_DEFAULT_TYPE_ATTRIBUTES (@var{type})
 If defined, a C statement that assigns default attributes to
 newly defined @var{type}.
+@end table
 
-@findex MERGE_MACHINE_TYPE_ATTRIBUTES
-@item MERGE_MACHINE_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
-Define this macro if the merging of type attributes needs special handling.
-If defined, the result is a list of the combined TYPE_ATTRIBUTES of
-@var{type1} and @var{type2}.  It is assumed that comptypes has already been
-called and returned 1.
-
-@findex MERGE_MACHINE_DECL_ATTRIBUTES
-@item MERGE_MACHINE_DECL_ATTRIBUTES (@var{olddecl}, @var{newdecl})
-Define this macro if the merging of decl attributes needs special handling.
-If defined, the result is a list of the combined DECL_MACHINE_ATTRIBUTES of
-@var{olddecl} and @var{newdecl}.  @var{newdecl} is a duplicate declaration
-of @var{olddecl}.  Examples of when this is needed are when one attribute
-overrides another, or when an attribute is nullified by a subsequent
-definition.
+@deftypefn {Target Hook} tree TARGET_MERGE_TYPE_ATTRIBUTES (tree @var{type1}, tree @var{type2})
+Define this target hook if the merging of type attributes needs special
+handling.  If defined, the result is a list of the combined
+@code{TYPE_ATTRIBUTES} of @var{type1} and @var{type2}.  It is assumed
+that @code{comptypes} has already been called and returned 1.  This
+function may call @code{merge_attributes} to handle machine-independent
+merging.
+@end deftypefn
+
+@deftypefn {Target Hook} tree TARGET_MERGE_DECL_ATTRIBUTES (tree @var{olddecl}, tree @var{newdecl})
+Define this target hook if the merging of decl attributes needs special
+handling.  If defined, the result is a list of the combined
+@code{DECL_MACHINE_ATTRIBUTES} of @var{olddecl} and @var{newdecl}.
+@var{newdecl} is a duplicate declaration of @var{olddecl}.  Examples of
+when this is needed are when one attribute overrides another, or when an
+attribute is nullified by a subsequent definition.  This function may
+call @code{merge_attributes} to handle machine-independent merging.
+
+@findex TARGET_DLLIMPORT_DECL_ATTRIBUTES
+If the only target-specific handling you require is @samp{dllimport} for
+Windows targets, you should define the macro
+@code{TARGET_DLLIMPORT_DECL_ATTRIBUTES}.  This links in a function
+called @code{merge_dllimport_decl_attributes} which can then be defined
+as the expansion of @code{TARGET_MERGE_DECL_ATTRIBUTES}.  This is done
+in @file{i386/cygwin.h} and @file{i386/i386.c}, for example.
+@end deftypefn
 
+@table @code
 @findex INSERT_ATTRIBUTES
 @item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
 Define this macro if you want to be able to add attributes to a decl
diff --git a/gcc/target-def.h b/gcc/target-def.h
new file mode 100644 (file)
index 0000000..1af66c3
--- /dev/null
@@ -0,0 +1,38 @@
+/* Default initializers for a generic GCC target.
+   Copyright (C) 2001 Free Software Foundation, Inc.
+
+This program 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.
+
+This program 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 this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them.   Help stamp out software-hoarding!  */
+
+/* See target.h for a desciption of what this file contains and how to
+   use it.  */
+
+/* Both in tree.c.  */
+#define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes
+#define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
+#define TARGET_VALID_DECL_ATTRIBUTE 0
+#define TARGET_VALID_TYPE_ATTRIBUTE 0
+
+/* The whole shebang.  */
+#define TARGET_INITIALIZER                     \
+{                                              \
+  TARGET_MERGE_DECL_ATTRIBUTES,                        \
+  TARGET_MERGE_TYPE_ATTRIBUTES,                        \
+  TARGET_VALID_DECL_ATTRIBUTE,                 \
+  TARGET_VALID_TYPE_ATTRIBUTE                  \
+}
diff --git a/gcc/target.h b/gcc/target.h
new file mode 100644 (file)
index 0000000..08d0568
--- /dev/null
@@ -0,0 +1,68 @@
+/* Data structure definitions for a generic GCC target.
+   Copyright (C) 2001 Free Software Foundation, Inc.
+
+This program 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.
+
+This program 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 this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them.   Help stamp out software-hoarding!  */
+
+/* This file contains a data structure that describes a GCC target.
+   At present, it is incomplete, but in future it should grow to
+   contain most or all target machine and target O/S specific
+   information.
+
+   This structure has its initializer declared in target-def.h in the
+   form of large macro TARGET_INITIALIZER that expands to many smaller
+   macros.
+
+   The smaller macros each initialize one component of the structure,
+   and each has a default.  Each target should have a file that
+   includes target.h and target-def.h, and overrides any inappropriate
+   defaults by undefining the relevant macro and defining a suitable
+   replacement.  That file should then contain the definition of
+   "target" like so:
+
+   struct gcc_target target = TARGET_INITIALIZER;
+
+   Doing things this way allows us to bring together everything that
+   defines a target to GCC.  By supplying a default that is
+   appropriate to most targets, we can easily add new items without
+   needing to edit dozens of target configuration files.  It should
+   also allow us to gradually reduce the amount of conditional
+   compilation that is scattered throughout GCC.  */
+
+struct gcc_target
+{
+  /* Given two decls, merge their attributes and return the result.  */
+  tree (* merge_decl_attributes) PARAMS ((tree, tree));
+
+  /* Given two types, merge their attributes and return the result.  */
+  tree (* merge_type_attributes) PARAMS ((tree, tree));
+
+  /* Nonzero if IDENTIFIER with arguments ARGS is a valid machine
+     specific attribute for DECL.  The attributes in ATTRIBUTES have
+     previously been assigned to DECL.  */
+  int (* valid_decl_attribute) PARAMS ((tree decl, tree attributes,
+                                       tree identifier, tree args));
+
+  /* Nonzero if IDENTIFIER with arguments ARGS is a valid machine
+     specific attribute for TYPE.  The attributes in ATTRIBUTES have
+     previously been assigned to TYPE.  */
+  int (* valid_type_attribute) PARAMS ((tree type, tree attributes,
+                                       tree identifier, tree args));
+};
+
+extern struct gcc_target target;
index 2461c9bd40eae88136921892e66ede6099a4f193..40524c39701641236d26ca3558aaa2e74bbf6b16 100644 (file)
@@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "hashtab.h"
 #include "output.h"
+#include "target.h"
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
@@ -2706,124 +2707,119 @@ build_type_attribute_variant (ttype, attribute)
   return ttype;
 }
 
-/* Return a 1 if ATTR_NAME and ATTR_ARGS is valid for either declaration DECL
-   or type TYPE and 0 otherwise.  Validity is determined the configuration
-   macros VALID_MACHINE_DECL_ATTRIBUTE and VALID_MACHINE_TYPE_ATTRIBUTE.  */
+/* Return 1 if ATTR_NAME and ATTR_ARGS is valid for either declaration
+   DECL or type TYPE and 0 otherwise.  Validity is determined the
+   target functions valid_decl_attribute and valid_machine_attribute.  */
 
 int
 valid_machine_attribute (attr_name, attr_args, decl, type)
-  tree attr_name;
-  tree attr_args ATTRIBUTE_UNUSED;
-  tree decl ATTRIBUTE_UNUSED;
-  tree type ATTRIBUTE_UNUSED;
-{
-  int validated = 0;
-#ifdef VALID_MACHINE_DECL_ATTRIBUTE
-  tree decl_attr_list = decl != 0 ? DECL_MACHINE_ATTRIBUTES (decl) : 0;
-#endif
-#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
-  tree type_attr_list = TYPE_ATTRIBUTES (type);
-#endif
-
+     tree attr_name;
+     tree attr_args;
+     tree decl;
+     tree type;
+{
   if (TREE_CODE (attr_name) != IDENTIFIER_NODE)
     abort ();
 
-#ifdef VALID_MACHINE_DECL_ATTRIBUTE
-  if (decl != 0
-      && VALID_MACHINE_DECL_ATTRIBUTE (decl, decl_attr_list, attr_name,
-                                      attr_args))
+  if (decl && target.valid_decl_attribute != NULL)
     {
-      tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
-                                   decl_attr_list);
+      tree decl_attrs = DECL_MACHINE_ATTRIBUTES (decl);
 
-      if (attr != NULL_TREE)
-       {
-         /* Override existing arguments.  Declarations are unique so we can
-            modify this in place.  */
-         TREE_VALUE (attr) = attr_args;
-       }
-      else
+      if ((*target.valid_decl_attribute) (decl, decl_attrs, attr_name,
+                                         attr_args))
        {
-         decl_attr_list = tree_cons (attr_name, attr_args, decl_attr_list);
-         decl = build_decl_attribute_variant (decl, decl_attr_list);
-       }
+         tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
+                                       decl_attrs);
 
-      validated = 1;
+         if (attr != NULL_TREE)
+           {
+             /* Override existing arguments.  Declarations are unique
+                so we can modify this in place.  */
+             TREE_VALUE (attr) = attr_args;
+           }
+         else
+           {
+             decl_attrs = tree_cons (attr_name, attr_args, decl_attrs);
+             decl = build_decl_attribute_variant (decl, decl_attrs);
+           }
+
+         /* Don't apply the attribute to both the decl and the type.  */
+         return 1;
+       }
     }
-#endif
 
-#ifdef VALID_MACHINE_TYPE_ATTRIBUTE
-  if (validated)
-    /* Don't apply the attribute to both the decl and the type.  */
-    ;
-  else if (VALID_MACHINE_TYPE_ATTRIBUTE (type, type_attr_list, attr_name,
-                                        attr_args))
+  if (target.valid_type_attribute != NULL)
     {
-      tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
-                                   type_attr_list);
+      tree type_attrs = TYPE_ATTRIBUTES (type);
 
-      if (attr != NULL_TREE)
+      if ((*target.valid_type_attribute) (type, type_attrs, attr_name,
+                                         attr_args))
        {
-         /* Override existing arguments.
-            ??? This currently works since attribute arguments are not
-            included in `attribute_hash_list'.  Something more complicated
-            may be needed in the future.  */
-         TREE_VALUE (attr) = attr_args;
-       }
-      else
-       {
-         /* If this is part of a declaration, create a type variant,
-            otherwise, this is part of a type definition, so add it
-            to the base type.  */
-         type_attr_list = tree_cons (attr_name, attr_args, type_attr_list);
-         if (decl != 0)
-           type = build_type_attribute_variant (type, type_attr_list);
-         else
-           TYPE_ATTRIBUTES (type) = type_attr_list;
-       }
-
-      if (decl != 0)
-       TREE_TYPE (decl) = type;
+         tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
+                                       type_attrs);
 
-      validated = 1;
-    }
+         if (attr != NULL_TREE)
+           {
+             /* Override existing arguments.  ??? This currently
+                works since attribute arguments are not included in
+                `attribute_hash_list'.  Something more complicated
+                may be needed in the future.  */
+             TREE_VALUE (attr) = attr_args;
+           }
+         else
+           {
+             /* If this is part of a declaration, create a type variant,
+                otherwise, this is part of a type definition, so add it
+                to the base type.  */
+             type_attrs = tree_cons (attr_name, attr_args, type_attrs);
+             if (decl != 0)
+               type = build_type_attribute_variant (type, type_attrs);
+             else
+               TYPE_ATTRIBUTES (type) = type_attrs;
+           }
 
-  /* Handle putting a type attribute on pointer-to-function-type by putting
-     the attribute on the function type.  */
-  else if (POINTER_TYPE_P (type)
-          && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
-          && VALID_MACHINE_TYPE_ATTRIBUTE (TREE_TYPE (type), type_attr_list,
-                                           attr_name, attr_args))
-    {
-      tree inner_type = TREE_TYPE (type);
-      tree inner_attr_list = TYPE_ATTRIBUTES (inner_type);
-      tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
-                                   type_attr_list);
+         if (decl)
+           TREE_TYPE (decl) = type;
 
-      if (attr != NULL_TREE)
-       TREE_VALUE (attr) = attr_args;
-      else
-       {
-         inner_attr_list = tree_cons (attr_name, attr_args, inner_attr_list);
-         inner_type = build_type_attribute_variant (inner_type,
-                                                    inner_attr_list);
+         return 1;
        }
 
-      if (decl != 0)
-       TREE_TYPE (decl) = build_pointer_type (inner_type);
-      else
+      /* Handle putting a type attribute on pointer-to-function-type
+        by putting the attribute on the function type.  */
+      else if (POINTER_TYPE_P (type)
+              && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
+              && (*target.valid_type_attribute) (TREE_TYPE (type), type_attrs,
+                                                 attr_name, attr_args))
        {
-         /* Clear TYPE_POINTER_TO for the old inner type, since
-            `type' won't be pointing to it anymore.  */
-         TYPE_POINTER_TO (TREE_TYPE (type)) = NULL_TREE;
-         TREE_TYPE (type) = inner_type;
-       }
+         tree inner_type = TREE_TYPE (type);
+         tree inner_attrs = TYPE_ATTRIBUTES (inner_type);
+         tree attr = lookup_attribute (IDENTIFIER_POINTER (attr_name),
+                                       type_attrs);
 
-      validated = 1;
+         if (attr != NULL_TREE)
+           TREE_VALUE (attr) = attr_args;
+         else
+           {
+             inner_attrs = tree_cons (attr_name, attr_args, inner_attrs);
+             inner_type = build_type_attribute_variant (inner_type,
+                                                        inner_attrs);
+           }
+
+         if (decl)
+           TREE_TYPE (decl) = build_pointer_type (inner_type);
+         else
+           {
+             /* Clear TYPE_POINTER_TO for the old inner type, since
+                `type' won't be pointing to it anymore.  */
+             TYPE_POINTER_TO (TREE_TYPE (type)) = NULL_TREE;
+             TREE_TYPE (type) = inner_type;
+           }
+
+         return 1;
+       }
     }
-#endif
 
-  return validated;
+  return 0;
 }
 
 /* Return non-zero if IDENT is a valid name for attribute ATTR,
@@ -2938,34 +2934,83 @@ merge_attributes (a1, a2)
 }
 
 /* Given types T1 and T2, merge their attributes and return
-   the result.  */
+  the result.  */
 
 tree
-merge_machine_type_attributes (t1, t2)
+merge_type_attributes (t1, t2)
      tree t1, t2;
 {
-#ifdef MERGE_MACHINE_TYPE_ATTRIBUTES
-  return MERGE_MACHINE_TYPE_ATTRIBUTES (t1, t2);
-#else
   return merge_attributes (TYPE_ATTRIBUTES (t1),
                           TYPE_ATTRIBUTES (t2));
-#endif
 }
 
 /* Given decls OLDDECL and NEWDECL, merge their attributes and return
    the result.  */
 
 tree
-merge_machine_decl_attributes (olddecl, newdecl)
+merge_decl_attributes (olddecl, newdecl)
      tree olddecl, newdecl;
 {
-#ifdef MERGE_MACHINE_DECL_ATTRIBUTES
-  return MERGE_MACHINE_DECL_ATTRIBUTES (olddecl, newdecl);
-#else
   return merge_attributes (DECL_MACHINE_ATTRIBUTES (olddecl),
                           DECL_MACHINE_ATTRIBUTES (newdecl));
-#endif
 }
+
+#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
+
+/* Specialization of merge_decl_attributes for various Windows targets.
+
+   This handles the following situation:
+
+     __declspec (dllimport) int foo;
+     int foo;
+
+   The second instance of `foo' nullifies the dllimport.  */
+
+tree
+merge_dllimport_decl_attributes (old, new)
+     tree old;
+     tree new;
+{
+  tree a;
+  int delete_dllimport_p;
+
+  old = DECL_MACHINE_ATTRIBUTES (old);
+  new = DECL_MACHINE_ATTRIBUTES (new);
+
+  /* What we need to do here is remove from `old' dllimport if it doesn't
+     appear in `new'.  dllimport behaves like extern: if a declaration is
+     marked dllimport and a definition appears later, then the object
+     is not dllimport'd.  */
+  if (lookup_attribute ("dllimport", old) != NULL_TREE
+      && lookup_attribute ("dllimport", new) == NULL_TREE)
+    delete_dllimport_p = 1;
+  else
+    delete_dllimport_p = 0;
+
+  a = merge_attributes (old, new);
+
+  if (delete_dllimport_p)
+    {
+      tree prev,t;
+
+      /* Scan the list for dllimport and delete it.  */
+      for (prev = NULL_TREE, t = a; t; prev = t, t = TREE_CHAIN (t))
+       {
+         if (is_attribute_p ("dllimport", TREE_PURPOSE (t)))
+           {
+             if (prev == NULL_TREE)
+               a = TREE_CHAIN (a);
+             else
+               TREE_CHAIN (prev) = TREE_CHAIN (t);
+             break;
+           }
+       }
+    }
+
+  return a;
+}
+
+#endif /* TARGET_DLLIMPORT_DECL_ATTRIBUTES  */
 \f
 /* Set the type qualifiers for TYPE to TYPE_QUALS, which is a bitmask
    of the various TYPE_QUAL values.  */
index 7805ef8987b6ad29a6ac6bf35c4a608921145a37..7f2881c1e7bf19b6e064b90d34604d68fa63ba54 100644 (file)
@@ -2039,8 +2039,8 @@ extern tree make_tree                     PARAMS ((tree, struct rtx_def *));
 extern tree build_type_attribute_variant PARAMS ((tree, tree));
 extern tree build_decl_attribute_variant PARAMS ((tree, tree));
 
-extern tree merge_machine_decl_attributes PARAMS ((tree, tree));
-extern tree merge_machine_type_attributes PARAMS ((tree, tree));
+extern tree merge_decl_attributes PARAMS ((tree, tree));
+extern tree merge_type_attributes PARAMS ((tree, tree));
 
 /* Split a list of declspecs and attributes into two.  */
 
@@ -2068,6 +2068,12 @@ extern tree lookup_attribute             PARAMS ((const char *, tree));
 
 extern tree merge_attributes           PARAMS ((tree, tree));
 
+#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
+/* Given two Windows decl attributes lists, possibly including
+   dllimport, return a list of their union .  */
+extern tree merge_dllimport_decl_attributes PARAMS ((tree, tree));
+#endif
+
 /* Return a version of the TYPE, qualified as indicated by the
    TYPE_QUALS, if one exists.  If no qualified version exists yet,
    return NULL_TREE.  */