]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target.h (struct gcc_target): Add comp_type_attributes and set_default_type_attributes.
authorJoseph Myers <jsm28@cam.ac.uk>
Fri, 29 Jun 2001 17:21:16 +0000 (18:21 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Fri, 29 Jun 2001 17:21:16 +0000 (18:21 +0100)
* target.h (struct gcc_target): Add comp_type_attributes and
set_default_type_attributes.
* target-def.h (TARGET_COMP_TYPE_ATTRIBUTES,
TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Define.
(TARGET_INITIALIZER): Update.
* doc/tm.texi (COMP_TYPE_ATTRIBUTES, TARGET_COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES):
Update documentation of old target macros to describe new target
hooks.
* tree.c (make_node): Use target.set_default_type_attributes.
(default_comp_type_attributes,
default_set_default_type_attributes): New functions.
* tree.h (default_comp_type_attributes,
default_set_default_type_attributes): Declare.
* c-typeck.c (COMP_TYPE_ATTRIBUTES): Don't define.
(comptypes): Use target.comp_type_attributes.
* config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h
(arc_comp_type_attributes, arc_set_default_type_attributes,
COMP_TYPE_ATTRIBUTES, SET_DEFAULT_TYPE_ATTRIBUTES): Remove
functions and macros with default behaviour.
* config/m32r/m32r-protos.h, config/m32r/m32r.c,
config/m32r/m32r.h (m32r_comp_type_attributes,
m32r_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
* config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c,
config/m68hc11/m68hc11.h (m68hc11_comp_type_attributes,
m68hc11_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
* config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c,
config/ns32k/ns32k.h (ns32k_comp_type_attributes,
COMP_TYPE_ATTRIBUTES): Likewise.
* config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
config/rs6000/rs6000.h (rs6000_comp_type_attributes,
rs6000_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
* config/d30v/d30v.h (COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES): Remove commented out macro
definitions.
* config/i386/i386.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
* config/ns32k/ns32k.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
* config/arm/arm.c (arm_comp_type_attributes,
arm_set_default_type_attributes): Make static.
(TARGET_COMP_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES):
Define.
* config/arm/arm.h (COMP_TYPE_ATTRIBUTES,
SET_DEFAULT_TYPE_ATTRIBUTES): Don't define.
* config/arm/arm-protos.h (arm_comp_type_attributes,
arm_set_default_type_attributes): Don't declare.
* config/i386/i386.c (ix86_comp_type_attributes): Make static.
(TARGET_COMP_TYPE_ATTRIBUTES): Define.
* config/i386/i386.h (COMP_TYPE_ATTRIBUTES): Don't define.
* config/i386/i386-protos.h (ix86_comp_type_attributes): Don't
declare.

cp:
* typeck.c (COMP_TYPE_ATTRIBUTES): Don't define.
(comptypes): Use target.comp_type_attributes.

From-SVN: r43655

31 files changed:
gcc/ChangeLog
gcc/c-typeck.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/d30v/d30v.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.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/ns32k/ns32k-protos.h
gcc/config/ns32k/ns32k.c
gcc/config/ns32k/ns32k.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/doc/tm.texi
gcc/target-def.h
gcc/target.h
gcc/tree.c
gcc/tree.h

index 8ced79461e64f9e3657b72151cc371e32839c003..ce064e9907231e201150ce6b3b190e96bb6a2c28 100644 (file)
@@ -1,3 +1,59 @@
+2001-06-29  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * target.h (struct gcc_target): Add comp_type_attributes and
+       set_default_type_attributes.
+       * target-def.h (TARGET_COMP_TYPE_ATTRIBUTES,
+       TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Define.
+       (TARGET_INITIALIZER): Update.
+       * doc/tm.texi (COMP_TYPE_ATTRIBUTES, TARGET_COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES):
+       Update documentation of old target macros to describe new target
+       hooks.
+       * tree.c (make_node): Use target.set_default_type_attributes.
+       (default_comp_type_attributes,
+       default_set_default_type_attributes): New functions.
+       * tree.h (default_comp_type_attributes,
+       default_set_default_type_attributes): Declare.
+       * c-typeck.c (COMP_TYPE_ATTRIBUTES): Don't define.
+       (comptypes): Use target.comp_type_attributes.
+       * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h
+       (arc_comp_type_attributes, arc_set_default_type_attributes,
+       COMP_TYPE_ATTRIBUTES, SET_DEFAULT_TYPE_ATTRIBUTES): Remove
+       functions and macros with default behaviour.
+       * config/m32r/m32r-protos.h, config/m32r/m32r.c,
+       config/m32r/m32r.h (m32r_comp_type_attributes,
+       m32r_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
+       * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c,
+       config/m68hc11/m68hc11.h (m68hc11_comp_type_attributes,
+       m68hc11_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
+       * config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c,
+       config/ns32k/ns32k.h (ns32k_comp_type_attributes,
+       COMP_TYPE_ATTRIBUTES): Likewise.
+       * config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
+       config/rs6000/rs6000.h (rs6000_comp_type_attributes,
+       rs6000_set_default_type_attributes, COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
+       * config/d30v/d30v.h (COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES): Remove commented out macro
+       definitions.
+       * config/i386/i386.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
+       * config/ns32k/ns32k.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise.
+       * config/arm/arm.c (arm_comp_type_attributes,
+       arm_set_default_type_attributes): Make static.
+       (TARGET_COMP_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES):
+       Define.
+       * config/arm/arm.h (COMP_TYPE_ATTRIBUTES,
+       SET_DEFAULT_TYPE_ATTRIBUTES): Don't define.
+       * config/arm/arm-protos.h (arm_comp_type_attributes,
+       arm_set_default_type_attributes): Don't declare.
+       * config/i386/i386.c (ix86_comp_type_attributes): Make static.
+       (TARGET_COMP_TYPE_ATTRIBUTES): Define.
+       * config/i386/i386.h (COMP_TYPE_ATTRIBUTES): Don't define.
+       * config/i386/i386-protos.h (ix86_comp_type_attributes): Don't
+       declare.
+
 2001-06-28  Jan van Male  <jan.vanmale@fenk.wau.nl>
 
        * predict.c (dump_prediction): Eliminate fprintf warning.
index 1a9ed5fe06bc281be57ba1f493fc6fe47933f8ed..bc9de485a3f9151bdbec4a2b9561c3773b5c49c1 100644 (file)
@@ -483,12 +483,8 @@ comptypes (type1, type2)
   if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))
     return 1;
 
-#ifndef COMP_TYPE_ATTRIBUTES
-#define COMP_TYPE_ATTRIBUTES(t1,t2)    1
-#endif
-
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
-  if (! (attrval = COMP_TYPE_ATTRIBUTES (t1, t2)))
+  if (! (attrval = (*target.comp_type_attributes) (t1, t2)))
      return 0;
 
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
index e550e68a22546daba9991555f52867c1a81c00d0..b264d632364e0ed01d77605f8664b744a5244a9c 100644 (file)
@@ -60,8 +60,6 @@ extern int shift_operator PARAMS ((rtx, enum machine_mode));
 
 #ifdef TREE_CODE
 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 void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
                                                enum machine_mode, tree,
                                                int *, int));
index c5c910690c989a532142e60f86c268e295a93e18..c579cd5f9b7811d699bb2dad87e4926124e56296 100644 (file)
@@ -342,24 +342,6 @@ arc_valid_decl_attribute (type, attributes, identifier, args)
   return 0;
 }
 
-/* Return zero if TYPE1 and TYPE are incompatible, one if they are compatible,
-   and two if they are nearly compatible (which causes a warning to be
-   generated).  */
-
-int
-arc_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED, type2 ATTRIBUTE_UNUSED;
-{
-  return 1;
-}
-
-/* Set the default attributes for TYPE.  */
-
-void
-arc_set_default_type_attributes (type)
-     tree type ATTRIBUTE_UNUSED;
-{
-}
 \f
 /* Acceptable arguments to the call insn.  */
 
index 4a78213a58e4014fd92587c198bb4c31d6288384..80ad885d8062cd865eb3dc1667a009ac803a4ca9 100644 (file)
@@ -1575,16 +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 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).  */
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-arc_comp_type_attributes (TYPE1, TYPE2)
-
-/* Give newly defined TYPE some default attributes.  */
-#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
-arc_set_default_type_attributes (TYPE)
-
 /* alloca should avoid clobbering the old register save area.  */
 /* ??? Not defined in tm.texi.  */
 #define SETJMP_VIA_SAVE_AREA
index 2d3ee1a77d73be3f7fc972fbd038d6dc0f80629f..653d788ded3e52b9ffe21ba7e7a69e59f2f72a52 100644 (file)
@@ -38,8 +38,6 @@ extern unsigned long arm_current_func_type    PARAMS ((void));
 
 #ifdef TREE_CODE
 extern int    arm_return_in_memory     PARAMS ((tree));
-extern int    arm_comp_type_attributes PARAMS ((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));
 #endif
index b673534525bbeccf7996851dd4b7088d316df949..97ca596b3f88fd4ecdaca819f628e94ca32a4fd6 100644 (file)
@@ -106,6 +106,8 @@ static int   arm_valid_type_attribute_p     PARAMS ((tree, tree,
                                                         tree, tree));
 static int      arm_valid_decl_attribute_p     PARAMS ((tree, tree,
                                                         tree, tree));
+static int      arm_comp_type_attributes       PARAMS ((tree, tree));
+static void     arm_set_default_type_attributes        PARAMS ((tree));
 #undef Hint
 #undef Mmode
 #undef Ulong
@@ -128,6 +130,12 @@ static int  arm_valid_decl_attribute_p     PARAMS ((tree, tree,
 #  define TARGET_VALID_DECL_ATTRIBUTE arm_valid_decl_attribute_p
 #endif
 
+#undef TARGET_COMP_TYPE_ATTRIBUTES
+#define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes
+
+#undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
+#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES arm_set_default_type_attributes
+
 struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Obstack for minipool constant handling.  */
@@ -1913,7 +1921,7 @@ arm_valid_type_attribute_p (type, attributes, identifier, args)
 /* Return 0 if the attributes for two types are incompatible, 1 if they
    are compatible, and 2 if they are nearly compatible (which causes a
    warning to be generated).  */
-int
+static int
 arm_comp_type_attributes (type1, type2)
      tree type1;
      tree type2;
@@ -1984,7 +1992,7 @@ arm_encode_call_attribute (decl, flag)
 /*  Assigns default attributes to newly defined type.  This is used to
     set short_call/long_call attributes for function types of
     functions defined inside corresponding #pragma scopes.  */
-void
+static void
 arm_set_default_type_attributes (type)
   tree type;
 {
index 88997d790667ccb33d03f81e02851365a72e068b..a4dff6dc6cc1a5d971974967cd2ac503d051ebf6 100644 (file)
@@ -2542,18 +2542,6 @@ extern const char * arm_pic_register_string;
    offset.  */
 extern int making_const_table;
 \f
-/* 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).  */
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  (arm_comp_type_attributes (TYPE1, TYPE2))
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
-  arm_set_default_type_attributes (TYPE)
-
 /* Handle pragmas for compatibility with Intel's compilers.  */
 #define REGISTER_TARGET_PRAGMAS(PFILE) do { \
   cpp_register_pragma (PFILE, 0, "long_calls", arm_pr_long_calls); \
index f072cfb96f84fb62b072e43a4f50f00a3c48c81d..2b08b117c89dff70b9b3b0d2b7ddbe2ba0a61386 100644 (file)
@@ -5889,15 +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 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).  */
-/* #define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) */
-
-/* If defined, a C statement that assigns default attributes to newly defined
-   TYPE.  */
-/* #define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) */
-
 /* Define this macro to control use of the character `$' in identifier names.
    The value should be 0, 1, or 2.  0 means `$' is not allowed by default; 1
    means it is allowed by default if `-traditional' is used; 2 means it is
index af1b345b2931256c1a0a18f260768725a63748b0..dfb2bccfa2c31348be16977adbbd12c097f60f47 100644 (file)
@@ -169,7 +169,6 @@ extern rtx ix86_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int))
 #endif
 
 #ifdef TREE_CODE
-extern int ix86_comp_type_attributes PARAMS ((tree, tree));
 extern int ix86_return_pops_args PARAMS ((tree, tree, int));
 
 extern int ix86_data_alignment PARAMS ((tree, int));
index 3d702ea3f3c54c500add47712795d7559da0802c..b4aab6beac2dd4f2e817ea657f20aa838329bc26 100644 (file)
@@ -607,6 +607,7 @@ 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_comp_type_attributes PARAMS ((tree, tree));
 \f
 /* Initialize the GCC target structure.  */
 #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
@@ -617,6 +618,9 @@ static void ix86_compute_frame_layout PARAMS ((struct ix86_frame *));
 #undef TARGET_VALID_TYPE_ATTRIBUTE
 #define TARGET_VALID_TYPE_ATTRIBUTE ix86_valid_type_attribute_p
 
+#undef TARGET_COMP_TYPE_ATTRIBUTES
+#define TARGET_COMP_TYPE_ATTRIBUTES ix86_comp_type_attributes
+
 struct gcc_target target = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
@@ -928,7 +932,7 @@ ix86_valid_type_attribute_p (type, attributes, identifier, args)
    are compatible, and 2 if they are nearly compatible (which causes a
    warning to be generated).  */
 
-int
+static int
 ix86_comp_type_attributes (type1, type2)
      tree type1;
      tree type2;
index 177e1321e370d53d16676548a4523ee3cb238405..bb77de3fdb5f5e040bbb083bdc2e7137aea7b0ff 100644 (file)
@@ -2240,19 +2240,6 @@ do                                                                       \
 while (0)
 
 \f
-/* 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).  */
-
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  (ix86_comp_type_attributes (TYPE1, TYPE2))
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-/* #define SET_DEFAULT_TYPE_ATTRIBUTES (TYPE) */
-
 /* Max number of args passed in registers.  If this is more than 3, we will
    have problems with ebx (register #4), since it is a caller save register and
    is also used as the pic register in ELF.  So for now, don't allow more than
index 5ab4a4ce1a65f5ca2e531bdcb7986e55a94f3c5a..a73b312158d8b41b6ff3eede507b4550bebe390b 100644 (file)
@@ -36,12 +36,10 @@ 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_comp_type_attributes                PARAMS ((tree, tree));
 extern void   m32r_select_section              PARAMS ((tree, int));
 extern void   m32r_encode_section_info         PARAMS ((tree));
 extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree));
 extern void   m32r_select_section              PARAMS ((tree, int));
-extern void   m32r_set_default_type_attributes  PARAMS ((tree));
 
 #ifdef HAVE_MACHINE_MODES
 extern void   m32r_setup_incoming_varargs      PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int *, int));
index a7763a2c25c7b9bc58edd37503c5b47d7613ed03..6530435c8c88c316a7e231fef258b3dd9c8e2317 100644 (file)
@@ -279,26 +279,6 @@ m32r_valid_decl_attribute (type, attributes, identifier, args)
 
   return 0;
 }
-
-/* Return zero if TYPE1 and TYPE are incompatible, one if they are compatible,
-   and two if they are nearly compatible (which causes a warning to be
-   generated).  */
-
-int
-m32r_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED;
-     tree type2 ATTRIBUTE_UNUSED;
-{
-  return 1;
-}
-
-/* Set the default attributes for TYPE.  */
-
-void
-m32r_set_default_type_attributes (type)
-     tree type ATTRIBUTE_UNUSED;
-{
-}
 \f
 /* A C statement or statements to switch to the appropriate
    section for output of DECL.  DECL is either a `VAR_DECL' node
index 8600e6ed7039bd6eb5d0b58c74c6c6d87bea5752..dfe4f289da76425375063d6c07f47357d5eb1b4b 100644 (file)
@@ -2111,16 +2111,6 @@ extern char m32r_punct_chars[];
 
 /* A function address in a call instruction.  */
 #define FUNCTION_MODE SImode
-
-/* 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).  */
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  m32r_comp_type_attributes (TYPE1, TYPE2)
-
-/* Give newly defined TYPE some default attributes.  */
-#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
-  m32r_set_default_type_attributes (TYPE)
 \f
 /* Define the information needed to generate branch and scc insns.  This is
    stored from the compare operation.  Note that we can't use "rtx" here
index 8c659b0571ea49be71499de4eff4b9d7fedc5ad4..b31770b9c7773d596a940adcd392e2f6009da7b6 100644 (file)
@@ -43,8 +43,6 @@ extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
                                                  enum machine_mode,
                                                  tree,
                                                  int));
-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));
 #endif
 
index 906c368f00aba757c08248c64f0de3f114686516..1d7669736e84018ffaeff2d6e5e8f74140a6a890 100644 (file)
@@ -1151,28 +1151,6 @@ m68hc11_valid_type_attribute_p (type, attributes, identifier, args)
   return 0;
 }
 
-/* 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).  */
-
-int
-m68hc11_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED;
-     tree type2 ATTRIBUTE_UNUSED;
-{
-  return 1;
-}
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-void
-m68hc11_set_default_type_attributes (type)
-     tree type ATTRIBUTE_UNUSED;
-{
-}
-
 /* Define this macro if references to a symbol must be treated
    differently depending on something about the variable or function
    named by the symbol (such as what section it is in).
index e9c38dea0b29ad1d3e319d4ad2e1c3708106cde3..5af1db2112a47b95058627d57742d140097b7b21 100644 (file)
@@ -1194,20 +1194,6 @@ typedef struct m68hc11_args
   m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
 
 \f
-/* 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).  */
-
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  (m68hc11_comp_type_attributes (TYPE1, TYPE2))
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
-  (m68hc11_set_default_type_attributes (TYPE))
-
 /* Define this macro if references to a symbol must be treated
    differently depending on something about the variable or function
    named by the symbol (such as what section it is in).
index 7c6da1bbca00f82cdc30a3f6bc630feb99d0dd9c..64b484b5f5a0abffb2acdced682cc60ce78cb2f5 100644 (file)
@@ -38,7 +38,6 @@ extern int symbolic_reference_mentioned_p PARAMS ((rtx));
 #endif /* RTX_CODE */
 
 #ifdef TREE_CODE
-extern int ns32k_comp_type_attributes PARAMS ((tree, tree));
 extern int ns32k_return_pops_args PARAMS ((tree, tree, int));
 #endif /* TREE_CODE */
 
index ec5470a05c23cb0ddcef9820ac79a5ceb7664bca..22a4b49b88ec1dbf119f5c1fbb7084c43e68ea8e 100644 (file)
@@ -670,18 +670,6 @@ ns32k_valid_type_attribute_p (type, attributes, identifier, args)
   return 0;
 }
 
-/* Return 0 if the attributes for two types are incompatible, 1 if they
-   are compatible, and 2 if they are nearly compatible (which causes a
-   warning to be generated).  */
-
-int
-ns32k_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED;
-     tree type2 ATTRIBUTE_UNUSED;
-{
-  return 1;
-}
-
 \f
 /* Value is the number of bytes of arguments automatically
    popped when returning from a subroutine call.
index e92140b797334b451ce28c3329670be86c56f8bc..3adc9bbd1b7c66fded35360614ca6f7c3dc67008 100644 (file)
@@ -1294,19 +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 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).  */
-
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  (ns32k_comp_type_attributes (TYPE1, TYPE2))
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-/* #define SET_DEFAULT_TYPE_ATTRIBUTES (TYPE) */
-\f
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.
    HI mode is more efficient but the range is not wide enough for
index cbcd25746336930d71673708f88e6a2ec50fc0bb..411244371219c4d925350f6b50c3b5fce899f8bc 100644 (file)
@@ -137,8 +137,6 @@ extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
                                            int *, int));
 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 void rs6000_set_default_type_attributes PARAMS ((tree));
 extern void rs6000_encode_section_info PARAMS ((tree));
 extern void rs6000_select_section PARAMS ((tree, int));
 extern void rs6000_unique_section PARAMS ((tree, int));
index 45e6bd40d0643def4fff5ce8ff218e70157815dc..2ef989ed44bc748baaf4a8d585bd5e9654ffd11d 100644 (file)
@@ -7853,29 +7853,6 @@ rs6000_valid_type_attribute_p (type, attributes, identifier, args)
   return 0;
 }
 
-/* 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).  */
-
-int
-rs6000_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED;
-     tree type2 ATTRIBUTE_UNUSED;
-{
-  return 1;
-}
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-void
-rs6000_set_default_type_attributes (type)
-     tree type ATTRIBUTE_UNUSED;
-{
-  return;
-}
-
 /* Return a reference suitable for calling a function with the
    longcall attribute.  */
 struct rtx_def *
index ad4768fdab8ec9d9047bb4d9990126c7546f5e4e..1a5690452555526582b2e6fdead0b8ece7df3efb 100644 (file)
@@ -1611,21 +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 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).  */
-
-#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
-  (rs6000_comp_type_attributes (TYPE1, TYPE2))
-
-/* If defined, a C statement that assigns default attributes to newly
-   defined TYPE.  */
-
-#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \
-  (rs6000_set_default_type_attributes (TYPE))
-
-\f
 /* Definitions for __builtin_return_address and __builtin_frame_address.
    __builtin_return_address (0) should give link register (65), enable
    this. */
index 62e1f4afb5b4f36dcfc8c87505758ea388507a35..2b55f03b64e281d4cbae57d43054c7af6091ff74 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-29  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+       * typeck.c (COMP_TYPE_ATTRIBUTES): Don't define.
+       (comptypes): Use target.comp_type_attributes.
+
 2001-06-29  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (flag_dump_class_layout): Remove unneeded declaration.
index db1044adeee688cc4b45d6c9d43421ea1ff97c85..cb1146ef7d3c961eba27cad8ec3304cb2b8db71b 100644 (file)
@@ -996,16 +996,10 @@ comptypes (t1, t2, strict)
   if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))
     return 1;
 
-  /* ??? COMP_TYPE_ATTRIBUTES is currently useless for variables as each
-     attribute is its own main variant (`val' will remain 0).  */
-#ifndef COMP_TYPE_ATTRIBUTES
-#define COMP_TYPE_ATTRIBUTES(t1,t2)    1
-#endif
-
   if (strict & COMPARE_NO_ATTRIBUTES)
     attrval = 1;
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
-  else if (! (attrval = COMP_TYPE_ATTRIBUTES (t1, t2)))
+  else if (! (attrval = (*target.comp_type_attributes) (t1, t2)))
      return 0;
 
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
index 991672cd3538b6b47985db6fd4cd0baeda73ee53..236b98dcf3c05a920d91bf26b5716da9d22827b1 100644 (file)
@@ -8299,19 +8299,18 @@ 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
+@deftypefn {Target Hook} int TARGET_COMP_TYPE_ATTRIBUTES (tree @var{type1}, tree @var{type2})
+If defined, this target hook is a function which returns zero if the attributes on
 @var{type1} and @var{type2} are incompatible, one if they are compatible,
 and two if they are nearly compatible (which causes a warning to be
-generated).
+generated).  If this is not defined, machine-specific attributes are
+supposed always to be compatible.
+@end deftypefn
 
-@findex SET_DEFAULT_TYPE_ATTRIBUTES
-@item SET_DEFAULT_TYPE_ATTRIBUTES (@var{type})
-If defined, a C statement that assigns default attributes to
+@deftypefn {Target Hook} void TARGET_SET_DEFAULT_TYPE_ATTRIBUTES (tree @var{type})
+If defined, this target hook is a function which assigns default attributes to
 newly defined @var{type}.
-@end table
+@end deftypefn
 
 @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
index 78fd30f6f235574a1dc42dfa73f2736ff564f33b..35c2ce8f5bb2c52d0baf8573a87ff0b67276de95 100644 (file)
@@ -30,6 +30,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
 #define TARGET_VALID_DECL_ATTRIBUTE default_valid_attribute_p
 #define TARGET_VALID_TYPE_ATTRIBUTE default_valid_attribute_p
+#define TARGET_COMP_TYPE_ATTRIBUTES default_comp_type_attributes
+#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES default_set_default_type_attributes
 
 /* The whole shebang.  */
 #define TARGET_INITIALIZER                     \
@@ -37,5 +39,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   TARGET_MERGE_DECL_ATTRIBUTES,                        \
   TARGET_MERGE_TYPE_ATTRIBUTES,                        \
   TARGET_VALID_DECL_ATTRIBUTE,                 \
-  TARGET_VALID_TYPE_ATTRIBUTE                  \
+  TARGET_VALID_TYPE_ATTRIBUTE,                 \
+  TARGET_COMP_TYPE_ATTRIBUTES,                 \
+  TARGET_SET_DEFAULT_TYPE_ATTRIBUTES           \
 }
index 6e97ee7f21f83ce6a230a70912751c2dad5578be..efdb5846ac16a5f40e78131629e8b1e7d71d9c28 100644 (file)
@@ -63,6 +63,14 @@ struct gcc_target
      previously been assigned to TYPE.  */
   int (* valid_type_attribute) PARAMS ((tree type, tree attributes,
                                        tree identifier, tree args));
+
+  /* Return 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).  */
+  int (* comp_type_attributes) PARAMS ((tree type1, tree type2));
+
+  /* Assign default attributes to the newly defined TYPE.  */
+  void (* set_default_type_attributes) PARAMS ((tree type));
 };
 
 extern struct gcc_target target;
index 6860e06887ff0aeb3e53aeec82187c99eb6fbfa7..04d46477bffd842978ca9e5d5bf7888c93f6c971 100644 (file)
@@ -433,9 +433,7 @@ make_node (code)
       TYPE_USER_ALIGN (t) = 0;
       TYPE_MAIN_VARIANT (t) = t;
       TYPE_ATTRIBUTES (t) = NULL_TREE;
-#ifdef SET_DEFAULT_TYPE_ATTRIBUTES
-      SET_DEFAULT_TYPE_ATTRIBUTES (t);
-#endif
+      (* target.set_default_type_attributes) (t);
       /* Note that we have not yet computed the alias set for this
         type.  */
       TYPE_ALIAS_SET (t) = -1;
@@ -2720,6 +2718,25 @@ default_valid_attribute_p PARAMS ((attr_name, attr_args, decl, type))
   return 0;
 }
 
+/* Default value of target.comp_type_attributes that always returns 1.  */
+
+int
+default_comp_type_attributes (type1, type2)
+     tree type1 ATTRIBUTE_UNUSED;
+     tree type2 ATTRIBUTE_UNUSED;
+{
+  return 1;
+}
+
+/* Default version of target.set_default_type_attributes that always does
+   nothing.  */
+
+void
+default_set_default_type_attributes (type)
+     tree type ATTRIBUTE_UNUSED;
+{
+}
+
 /* 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.  */
index 4f8dbef44eb953504ae73b85e74e45b5ab35cde1..9a5fb6a5137ba569c88ab024855616f3be732862 100644 (file)
@@ -2044,6 +2044,8 @@ extern tree build_decl_attribute_variant PARAMS ((tree, tree));
 extern tree merge_decl_attributes PARAMS ((tree, tree));
 extern tree merge_type_attributes PARAMS ((tree, tree));
 extern int default_valid_attribute_p PARAMS ((tree, tree, tree, tree));
+extern int default_comp_type_attributes PARAMS ((tree, tree));
+extern void default_set_default_type_attributes PARAMS ((tree));
 
 /* Split a list of declspecs and attributes into two.  */