aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-04-19 06:22:18 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-04-19 06:22:18 +0000
commitab393bf17171d4e242ffd2fe637ae38322ab4d6e (patch)
treec853f107a81212ea73e1c0e425bd739bab49ff8e /gcc/c-common.c
parent58533fa280d2d55e932c8ed979e5ee167cdc7891 (diff)
downloadgcc-ab393bf17171d4e242ffd2fe637ae38322ab4d6e.zip
gcc-ab393bf17171d4e242ffd2fe637ae38322ab4d6e.tar.gz
gcc-ab393bf17171d4e242ffd2fe637ae38322ab4d6e.tar.bz2
builtins.c: Include langhooks.h.
* builtins.c: Include langhooks.h. (lang_type_promotes_to): Remove. (expand_builtin_va_arg): Use new hook. * c-common.c (c_common_nodes_and_builtins): Don't set hook. (simple_type_promotes_to): Move to c-typeck.c. * c-common.h (simple_type_promotes_to): Remove. * c-decl.c (duplicate_decls, grokdeclarator): Update. * c-format.c: Include langhooks.h. (check_format_types): Update. * c-tree.h (c_type_promotes_to): New. * c-typeck.c (c_type_promotes_to): Move from c-common.c. (type_lists_compatible_p): Update. * langhooks-def.h (lhd_type_promotes_to): New. (LANG_HOOKS_TYPE_PROMOTES_TO): New. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update. * langhooks.c (lhd_type_promotes_to): New. * langhooks.h (struct lang_hooks_for_types): New hook. * tree.h (lang_type_promotes_to): Remove. cp: * call.c (convert_type_from_ellipsis): Rename, update. * cp-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. * cp-tree.h (convert_type_from_ellipsis): Rename. * decl.c (cxx_init_decl_processing): Don't set hook. objc: * objc-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. From-SVN: r52512
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1e7a065..c1201cd 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2928,10 +2928,6 @@ c_common_nodes_and_builtins ()
0, NOT_BUILT_IN, 0, 0, 1);
main_identifier_node = get_identifier ("main");
-
- /* ??? Perhaps there's a better place to do this. But it is related
- to __builtin_va_arg, so it isn't that off-the-wall. */
- lang_type_promotes_to = simple_type_promotes_to;
}
tree
@@ -3075,32 +3071,6 @@ c_promoting_integer_type_p (t)
}
}
-/* Given a type, apply default promotions wrt unnamed function arguments
- and return the new type. Return NULL_TREE if no change. */
-/* ??? There is a function of the same name in the C++ front end that
- does something similar, but is more thorough and does not return NULL
- if no change. We could perhaps share code, but it would make the
- self_promoting_type property harder to identify. */
-
-tree
-simple_type_promotes_to (type)
- tree type;
-{
- if (TYPE_MAIN_VARIANT (type) == float_type_node)
- return double_type_node;
-
- if (c_promoting_integer_type_p (type))
- {
- /* Preserve unsignedness if not really getting any wider. */
- if (TREE_UNSIGNED (type)
- && (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
- return unsigned_type_node;
- return integer_type_node;
- }
-
- return NULL_TREE;
-}
-
/* Return 1 if PARMS specifies a fixed number of parameters
and none of their types is affected by default promotions. */