aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2009-05-21 03:06:12 +0000
committerSandra Loosemore <sandra@codesourcery.com>2009-05-21 03:06:12 +0000
commit464350a49083a38728812f627296223773ebe3fa (patch)
tree09231bb5a5f48721cdd7033ca7c944b29771f3cf /gcc/c-typeck.c
parentbd5973dc3844f7ba1edfb0b05dff5f8d7a406e5b (diff)
2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
gcc/ * doc/tm.texi (Misc): Document TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE, TARGET_PROMOTED_TYPE, and TARGET_CONVERT_TO_TYPE. * hooks.c (hook_tree_const_tree_null): Define. * hooks.h (hook_tree_const_tree_null): Declare. * target.h (struct gcc_target): Add invalid_parameter_type, invalid_return_type, promoted_type, and convert_to_type fields. * target-def.h: (TARGET_INVALID_PARAMETER_TYPE): Define. (TARGET_INVALID_RETURN_TYPE): Define. (TARGET_PROMOTED_TYPE): Define. (TARGET_CONVERT_TO_TYPE): Define. (TARGET_INITIALIZER): Update for new fields. * c-decl.c (grokdeclarator): Check targetm.invalid_return_type. (grokparms): Check targetm.invalid_parameter_type. * c-typeck.c (default_conversion): Check targetm.promoted_type. * c-convert.c (convert): Check targetm.convert_to_type. gcc/cp/ * typeck.c (default_conversion): Check targetm.promoted_type. * decl.c (grokdeclarator): Check targetm.invalid_return_type. (grokparms): Check targetm.invalid_parameter_type. * cvt.c (ocp_convert): Check targetm.convert_to_type. (build_expr_type_conversion): Check targetm.promoted_type. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@147758 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index ee1853a0f73..1a1b009398c 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1766,6 +1766,7 @@ default_conversion (tree exp)
tree orig_exp;
tree type = TREE_TYPE (exp);
enum tree_code code = TREE_CODE (type);
+ tree promoted_type;
/* Functions and arrays have been converted during parsing. */
gcc_assert (code != FUNCTION_TYPE);
@@ -1793,6 +1794,10 @@ default_conversion (tree exp)
if (exp == error_mark_node)
return error_mark_node;
+ promoted_type = targetm.promoted_type (type);
+ if (promoted_type)
+ return convert (promoted_type, exp);
+
if (INTEGRAL_TYPE_P (type))
return perform_integral_promotions (exp);