diff options
author | Michael Meissner <meissner@gcc.gnu.org> | 2007-09-13 02:17:51 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2007-09-13 02:17:51 +0000 |
commit | 04e1d06b795dc7dfa11be5e0ee04467a28e105dd (patch) | |
tree | 2550bf2be428ffb45e9bcb30a6c3186b44ebdc0d /gcc/config/i386/netware.c | |
parent | ceaa2d5019c290d814e0856531e9b45cbff6b90b (diff) | |
download | gcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.zip gcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.tar.gz gcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.tar.bz2 |
Add AMD SSE5 support; Add iterator over function arguments; Add stdarg_p, prototype_p, function_args_count functions
From-SVN: r128455
Diffstat (limited to 'gcc/config/i386/netware.c')
-rw-r--r-- | gcc/config/i386/netware.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/gcc/config/i386/netware.c b/gcc/config/i386/netware.c index 45a63a9..0357baf 100644 --- a/gcc/config/i386/netware.c +++ b/gcc/config/i386/netware.c @@ -45,30 +45,36 @@ gen_stdcall_or_fastcall_decoration (tree decl, char prefix) of DECL_ASSEMBLER_NAME. */ const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); char *newsym; - tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + tree type = TREE_TYPE (decl); + tree arg; + function_args_iterator args_iter; - if (formal_type != NULL_TREE) + if (prototype_p (type)) { /* These attributes are ignored for variadic functions in i386.c:ix86_return_pops_args. For compatibility with MS compiler do not add @0 suffix here. */ - if (TREE_VALUE (tree_last (formal_type)) != void_type_node) + if (stdarg_p (type)) return NULL_TREE; /* Quit if we hit an incomplete type. Error is reported by convert_arguments in c-typeck.c or cp/typeck.c. */ - while (TREE_VALUE (formal_type) != void_type_node - && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) + FOREACH_FUNCTION_ARGS(type, arg, args_iter) { - unsigned parm_size - = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + unsigned parm_size; + + if (! COMPLETE_TYPE_P (arg)) + break; + + parm_size = int_size_in_bytes (TYPE_SIZE (arg)); + if (parm_size < 0) + break; /* Must round up to include padding. This is done the same way as in store_one_arg. */ parm_size = ((parm_size + PARM_BOUNDARY - 1) / PARM_BOUNDARY * PARM_BOUNDARY); total += parm_size; - formal_type = TREE_CHAIN (formal_type); } } @@ -93,28 +99,32 @@ gen_regparm_prefix (tree decl, unsigned nregs) of DECL_ASSEMBLER_NAME. */ const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); char *newsym; - tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + tree type = TREE_TYPE (decl); + tree arg; + function_args_iterator args_iter; - if (formal_type != NULL_TREE) + if (prototype_p (type)) { /* This attribute is ignored for variadic functions. */ - if (TREE_VALUE (tree_last (formal_type)) != void_type_node) + if (stdarg_p (type)) return NULL_TREE; /* Quit if we hit an incomplete type. Error is reported by convert_arguments in c-typeck.c or cp/typeck.c. */ - while (TREE_VALUE (formal_type) != void_type_node - && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) + FOREACH_FUNCTION_ARGS(type, arg, args_iter) { - unsigned parm_size - = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + unsigned parm_size; + + if (! COMPLETE_TYPE_P (arg)) + break; + + parm_size = int_size_in_bytes (arg); + if (parm_size < 0) + break; - /* Must round up to include padding. This is done the same - way as in store_one_arg. */ parm_size = ((parm_size + PARM_BOUNDARY - 1) / PARM_BOUNDARY * PARM_BOUNDARY); total += parm_size; - formal_type = TREE_CHAIN (formal_type); } } |