aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2010-05-28 11:58:35 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2010-05-28 13:58:35 +0200
commitd4048208a4c81eca9372664003b09922b9d5d1aa (patch)
treec3d191d473097e189086bc6f9d252e42b7ae28ce /gcc
parent40dcd88bb984adbf44039ecef933bd061a810e06 (diff)
downloadgcc-d4048208a4c81eca9372664003b09922b9d5d1aa.zip
gcc-d4048208a4c81eca9372664003b09922b9d5d1aa.tar.gz
gcc-d4048208a4c81eca9372664003b09922b9d5d1aa.tar.bz2
c-common.c (c_common_nodes_and_builtins): Replace use of TARGET_ENUM_VA_LIST by target hook enum_va_list.
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. From-SVN: r159966
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/c-common.c28
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/doc/tm.texi28
-rw-r--r--gcc/target-def.h5
-rw-r--r--gcc/target.h3
7 files changed, 49 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 79f2ca7..92dc7f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1fd11c5..77026fa 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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)
{
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index bb9bb64..c26a732 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 3dd6f43..7e1d6cf 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index de56de6..6e68d2e 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 4db3997..1097723 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -538,6 +538,10 @@
#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
@@ -1009,6 +1013,7 @@
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, \
diff --git a/gcc/target.h b/gcc/target.h
index 6f045da..e17cc21 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -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);