]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in (opts.o): Depend on target.h.
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 23 Feb 2004 14:10:58 +0000 (14:10 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 23 Feb 2004 14:10:58 +0000 (14:10 +0000)
* Makefile.in (opts.o): Depend on target.h.
* opts.c (decode_options): Use targetm.default_short_enums
instead of DEFAULT_SHORT_ENUMS.
* system.h (DEFAULT_SHORT_ENUMS): Poison.
* target-def.h (TARGET_DEFAULT_SHORT_ENUMS): New.
(TARGET_INITIALIZER): Add TARGET_DEFAULT_SHORT_ENUMS.
* target.h (gcc_target): Add default_short_enums.
* config/cris/cris.h: Remove a comment about
DEFAULT_SHORT_ENUMS.
* config/ip2k/ip2k.h: Likewise.
* doc/tm.texi (DEFAULT_SHORT_ENUMS): Change to
TARGET_DEFAULT_SHORT_ENUMS.  Update the description.

From-SVN: r78303

gcc/ChangeLog
gcc/Makefile.in
gcc/config/cris/cris.h
gcc/config/ip2k/ip2k.h
gcc/doc/tm.texi
gcc/opts.c
gcc/system.h
gcc/target-def.h
gcc/target.h

index e73f7b22795a6bcd7caa4ed6bcd7dcd3c0f06e83..17ee9e2c9e7825ff5bf97d7cd269184d4ef670d8 100644 (file)
@@ -1,3 +1,18 @@
+2004-02-23  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * Makefile.in (opts.o): Depend on target.h.
+       * opts.c (decode_options): Use targetm.default_short_enums
+       instead of DEFAULT_SHORT_ENUMS.
+       * system.h (DEFAULT_SHORT_ENUMS): Poison.
+       * target-def.h (TARGET_DEFAULT_SHORT_ENUMS): New.
+       (TARGET_INITIALIZER): Add TARGET_DEFAULT_SHORT_ENUMS.
+       * target.h (gcc_target): Add default_short_enums.
+       * config/cris/cris.h: Remove a comment about
+       DEFAULT_SHORT_ENUMS.
+       * config/ip2k/ip2k.h: Likewise.
+       * doc/tm.texi (DEFAULT_SHORT_ENUMS): Change to
+       TARGET_DEFAULT_SHORT_ENUMS.  Update the description.
+
 2004-02-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
             Falk Hueffner  <falk@debian.org>
 
index 0c1b23cb8b5b8a2fe1718c64cde7354d869699ff..f394b5f66af91d0fe0bcc681b9e339b6ac798ab4 100644 (file)
@@ -1524,7 +1524,7 @@ diagnostic.o : diagnostic.c $(DIAGNOSTIC_H) real.h \
    input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
 opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
        coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
-       output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h
+       output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h target.h
 targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \
        coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \
        output.h toplev.h
index 5110f9adbfb92484e923f0a43c5988160da6912d..10147b272590f46371d25c86398e760bf70bbe17 100644 (file)
@@ -567,8 +567,6 @@ extern int target_flags;
 /* For compatibility and historical reasons, a char should be signed.  */
 #define DEFAULT_SIGNED_CHAR 1
 
-/* No DEFAULT_SHORT_ENUMS, please.  */
-
 /* Note that WCHAR_TYPE_SIZE is used in cexp.y,
    where TARGET_SHORT is not available.  */
 #undef WCHAR_TYPE
index 6457e8bb3eff5965702fdf1353b1179ce5c4cbde..4685d030c1c0fa5edb0d5f1d77e91c3d90d6d8e0 100644 (file)
@@ -108,12 +108,6 @@ extern int target_flags;
 
 #define DEFAULT_SIGNED_CHAR 1
 
-/* #define DEFAULT_SHORT_ENUMS 1
-   This was the default for the IP2k but gcc has a bug (as of 17th May
-   2001) in the way that library calls to the memory checker functions
-   are issues that screws things up if an enum is not equivalent to
-   an int.  */
-
 #define SIZE_TYPE "unsigned int"
 
 #define PTRDIFF_TYPE "int"
index 395eec808933dbaa1a5cc31402f5b610a40c00e8..e618c8eff81b5a15ae6ad656d24b4a9e06d457b1 100644 (file)
@@ -1605,14 +1605,14 @@ always override this default with the options @option{-fsigned-char}
 and @option{-funsigned-char}.
 @end defmac
 
-@defmac DEFAULT_SHORT_ENUMS
-A C expression to determine whether to give an @code{enum} type
-only as many bytes as it takes to represent the range of possible values
-of that type.  A nonzero value means to do that; a zero value means all
+@deftypefn {Target Hook} bool TARGET_DEFAULT_SHORT_ENUMS (void)
+This target hook should return true if the compiler should give an
+@code{enum} type only as many bytes as it takes to represent the range
+of possible values of that type.  It should return false if all
 @code{enum} types should be allocated like @code{int}.
 
-If you don't define the macro, the default is 0.
-@end defmac
+The default is to return false.
+@end deftypefn
 
 @defmac SIZE_TYPE
 A C expression for a string describing the name of the data type to use
index 45acba3c4f765aae6a22c75ca0614ef67f3a5b5a..a83357b72ddaee8118525e39c903f96400396db9 100644 (file)
@@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "diagnostic.h"
 #include "tm_p.h"              /* For OPTIMIZATION_OPTIONS.  */
 #include "insn-attr.h"         /* For INSN_SCHEDULING.  */
+#include "target.h"
 
 /* Value of the -G xx switch, and whether it was passed or not.  */
 unsigned HOST_WIDE_INT g_switch_value;
@@ -594,10 +595,8 @@ decode_options (unsigned int argc, const char **argv)
 
   /* Initialize whether `char' is signed.  */
   flag_signed_char = DEFAULT_SIGNED_CHAR;
-#ifdef DEFAULT_SHORT_ENUMS
   /* Initialize how much space enums occupy, by default.  */
-  flag_short_enums = DEFAULT_SHORT_ENUMS;
-#endif
+  flag_short_enums = targetm.default_short_enums ();
 
   /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
      modify it.  */
index 31a1b92357f4ce343038ca2ed7159720b3413740..2631de178df911373c5feebd2e78ab934e1038f5 100644 (file)
@@ -605,7 +605,8 @@ typedef char _Bool;
        ASM_OUTPUT_SECTION_NAME PROMOTE_FUNCTION_ARGS                   \
        STRUCT_VALUE_INCOMING STRICT_ARGUMENT_NAMING                    \
        PROMOTE_FUNCTION_RETURN PROMOTE_PROTOTYPES STRUCT_VALUE_REGNUM  \
-       SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS
+       SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS                  \
+       DEFAULT_SHORT_ENUMS
 
 /* Other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
index 289ab412c6eec9ea668d9ac4b02d5de1aca6a25b..ef4c777378c69ba26ce8af2b755cbcd5fbabe085 100644 (file)
@@ -325,6 +325,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #define TARGET_GET_PCH_VALIDITY default_get_pch_validity
 #define TARGET_PCH_VALID_P default_pch_valid_p
 
+#define TARGET_DEFAULT_SHORT_ENUMS hook_bool_void_false
+
 #define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_false
 #define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_false
 #define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_false
@@ -390,6 +392,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   TARGET_BUILD_BUILTIN_VA_LIST,                        \
   TARGET_GET_PCH_VALIDITY,                     \
   TARGET_PCH_VALID_P,                          \
+  TARGET_DEFAULT_SHORT_ENUMS,                  \
   TARGET_HAVE_NAMED_SECTIONS,                  \
   TARGET_HAVE_CTORS_DTORS,                     \
   TARGET_HAVE_TLS,                             \
index aa56d64f5720998f14e7b200975631de2b80f456..ed96b02efe4d7c2595ec4eae09aa770c0d57bdd3 100644 (file)
@@ -410,6 +410,11 @@ struct gcc_target
   void * (* get_pch_validity) (size_t *);
   const char * (* pch_valid_p) (const void *, size_t);
 
+  /* True if the compiler should give an @code{enum} type only as many
+     bytes as it takes to represent the range of possible values of
+     that type.  */
+  bool (* default_short_enums) (void);
+
   /* Leave the boolean fields at the end.  */
 
   /* True if arbitrary sections are supported.  */