]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-05-28 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 May 2010 11:58:35 +0000 (11:58 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 May 2010 11:58:35 +0000 (11:58 +0000)
        * c-common.c (c_common_nodes_and_builtins): Replace use
        of TARGET_ENUM_VA_LIST by target hook enum_va_list.
        * config/i386/i386.c (TARGET_ENUM_VA_LIST_P): Hook
        to ix86_enum_va_list.
        * config/i386/i386.h (TARGET_ENUM_VA_LIST): Removed.
        * doc/tm.texi (TARGET_ENUM_VA_LIST): Removed.
        (TARGET_ENUM_VA_LIST_P): Add hook description.
        * target-def.h (TARGET_ENUM_VA_LIST_P): Added.
        * target.h (gcc_target): Add enum_va_list hook.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159966 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-common.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/doc/tm.texi
gcc/target-def.h
gcc/target.h

index 79f2ca73a38e23c3787d591d5ab22ee781b2545b..92dc7f7b099ea308fb1f66dc08fbaf4bf7c10c91 100644 (file)
@@ -1,5 +1,15 @@
 2010-05-28  Kai Tietz  <kai.tietz@onevision.com>
 
+       * c-common.c (c_common_nodes_and_builtins): Replace use
+       of TARGET_ENUM_VA_LIST by target hook enum_va_list.
+       * config/i386/i386.c (TARGET_ENUM_VA_LIST_P): Hook
+       to ix86_enum_va_list.
+       * config/i386/i386.h (TARGET_ENUM_VA_LIST): Removed.
+       * doc/tm.texi (TARGET_ENUM_VA_LIST): Removed.
+       (TARGET_ENUM_VA_LIST_P): Add hook description.
+       * target-def.h (TARGET_ENUM_VA_LIST_P): Added.
+       * target.h (gcc_target): Add enum_va_list hook.
+
        PR bootstrap/44299
        * config/i386/t-cygming: Adjust header dependencies for winnt-cxx.c.
        * config/i386/winnt-cxx.c (IN_GCC_FRONTEND): Remove undefine.
index 1fd11c50c64f7aa53f987b91e32e1f4c3f1d735b..77026faf64b023feecd2d2938cf00ae909c20782 100644 (file)
@@ -5114,21 +5114,21 @@ c_common_nodes_and_builtins (void)
     (build_decl (UNKNOWN_LOCATION,
                 TYPE_DECL, get_identifier ("__builtin_va_list"),
                 va_list_type_node));
-#ifdef TARGET_ENUM_VA_LIST
-  {
-    int l;
-    const char *pname;
-    tree ptype;
-    for (l = 0; TARGET_ENUM_VA_LIST (l, &pname, &ptype); ++l)
-      {
-       lang_hooks.decls.pushdecl
-         (build_decl (UNKNOWN_LOCATION,
-                      TYPE_DECL, get_identifier (pname),
-                      ptype));
+  if (targetm.enum_va_list)
+    {
+      int l;
+      const char *pname;
+      tree ptype;
 
-      }
-  }
-#endif
+      for (l = 0; targetm.enum_va_list (l, &pname, &ptype); ++l)
+       {
+         lang_hooks.decls.pushdecl
+           (build_decl (UNKNOWN_LOCATION,
+                        TYPE_DECL, get_identifier (pname),
+                        ptype));
+
+       }
+    }
 
   if (TREE_CODE (va_list_type_node) == ARRAY_TYPE)
     {
index bb9bb6415fde3e1c6a3a58a695324819f2bc96ce..c26a7323ee471e9c90641f48684ad75b2d5453f6 100644 (file)
@@ -30738,6 +30738,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
 #undef TARGET_BUILD_BUILTIN_VA_LIST
 #define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list
 
+#undef TARGET_ENUM_VA_LIST_P
+#define TARGET_ENUM_VA_LIST_P ix86_enum_va_list
+
 #undef TARGET_FN_ABI_VA_LIST
 #define TARGET_FN_ABI_VA_LIST ix86_fn_abi_va_list
 
index 3dd6f43b67d13b9b3d70624a4f42969ebf9b11d9..7e1d6cf50aeceffc320b7e3a8e8ceab5e7b94d3c 100644 (file)
@@ -2450,11 +2450,6 @@ struct GTY(()) machine_function {
 #undef TARG_COND_BRANCH_COST
 #define TARG_COND_BRANCH_COST           ix86_cost->branch_cost
 
-/* Enum through the target specific extra va_list types.
-   Please, do not iterate the base va_list type name.  */
-#define TARGET_ENUM_VA_LIST(IDX, PNAME, PTYPE) \
-  (TARGET_64BIT ? ix86_enum_va_list (IDX, PNAME, PTYPE) : 0)
-
 /* Cost of any scalar operation, excluding load and store.  */
 #undef TARG_SCALAR_STMT_COST
 #define TARG_SCALAR_STMT_COST           ix86_cost->scalar_stmt_cost
index de56de69b6c7d7d64b43e15200bdca7b0404c5b5..6e68d2ea8d311164b3b7b1fdaa8d2b579f243d94 100644 (file)
@@ -4298,6 +4298,20 @@ This hook returns a type node for @code{va_list} for the target.
 The default version of the hook returns @code{void*}.
 @end deftypefn
 
+@deftypefn {Target Hook} int TARGET_ENUM_VA_LIST_P (int @var{idx}, const char ** @var{pname}, tree @var{ptype})
+This target hook is used in function @code{c_common_nodes_and_builtins}
+to iterate through the target specific builtin types for va_list. The
+variable @var{idx} is used as iterator. @var{pname} has to be a pointer
+to a @code{const char *} and @var{ptype} a pointer to a @code{tree} typed
+variable.
+The arguments @var{pname} and @var{ptype} are used to store the result of
+this macro and are set to the name of the va_list builtin type and its
+internal type.
+If the return value of this macro is zero, then there is no more element.
+Otherwise the @var{IDX} should be increased for the next call of this
+macro to iterate through all types.
+@end deftypefn
+
 @deftypefn {Target Hook} tree TARGET_FN_ABI_VA_LIST (tree @var{fndecl})
 This hook returns the va_list type of the calling convention specified by
 @var{fndecl}.
@@ -4494,20 +4508,6 @@ should recognize only the caller's register numbers.
 If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.
 @end deftypefn
 
-@defmac TARGET_ENUM_VA_LIST (@var{idx}, @var{pname}, @var{ptype})
-This target macro is used in function @code{c_common_nodes_and_builtins}
-to iterate through the target specific builtin types for va_list. The
-variable @var{idx} is used as iterator. @var{pname} has to be a pointer
-to a @code{const char *} and @var{ptype} a pointer to a @code{tree} typed
-variable.
-The arguments @var{pname} and @var{ptype} are used to store the result of
-this macro and are set to the name of the va_list builtin type and its
-internal type.
-If the return value of this macro is zero, then there is no more element.
-Otherwise the @var{IDX} should be increased for the next call of this
-macro to iterate through all types.
-@end defmac
-
 @defmac APPLY_RESULT_SIZE
 Define this macro if @samp{untyped_call} and @samp{untyped_return}
 need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
index 4db3997ad114565d2163481f23eb7c2c615269b4..109772329d634b18411718744d37b52357040f0c 100644 (file)
 #define TARGET_SCALAR_MODE_SUPPORTED_P default_scalar_mode_supported_p
 #endif
 
+#ifndef TARGET_ENUM_VA_LIST_P
+#define TARGET_ENUM_VA_LIST_P NULL
+#endif
+
 #ifndef TARGET_DECIMAL_FLOAT_SUPPORTED_P
 #define TARGET_DECIMAL_FLOAT_SUPPORTED_P default_decimal_float_supported_p
 #endif
   TARGET_CC_MODES_COMPATIBLE,                  \
   TARGET_MACHINE_DEPENDENT_REORG,              \
   TARGET_BUILD_BUILTIN_VA_LIST,                        \
+  TARGET_ENUM_VA_LIST_P,                       \
   TARGET_FN_ABI_VA_LIST,                       \
   TARGET_CANONICAL_VA_LIST_TYPE,               \
   TARGET_EXPAND_BUILTIN_VA_START,              \
index 6f045da12996bb66783d884c12dc978361a47e9e..e17cc21f9fca79fa64cdf128b414feb2435e5d1b 100644 (file)
@@ -844,6 +844,9 @@ struct gcc_target
   /* Create the __builtin_va_list type.  */
   tree (* build_builtin_va_list) (void);
 
+  /* Enumerate the va list variants.  */
+  int (* enum_va_list) (int, const char **, tree *);
+
   /* Get the cfun/fndecl calling abi __builtin_va_list type.  */
   tree (* fn_abi_va_list) (tree);