summaryrefslogtreecommitdiffstats
path: root/gcc/java/typeck.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/typeck.c')
-rw-r--r--gcc/java/typeck.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 4db69b4ea0c..2b85e475d95 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -129,8 +129,8 @@ convert (tree type, tree expr)
return error_mark_node;
if (code == VOID_TYPE)
return build1 (CONVERT_EXPR, type, expr);
- if (code == BOOLEAN_TYPE)
- return fold (convert_to_boolean (type, expr));
+ if (code == BOOLEAN_TYPE || code == CHAR_TYPE)
+ return fold (build1 (CONVERT_EXPR, type, expr));
if (code == INTEGER_TYPE)
{
if ((really_constant_p (expr)
@@ -151,8 +151,6 @@ convert (tree type, tree expr)
}
if (code == REAL_TYPE)
return fold (convert_to_real (type, expr));
- if (code == CHAR_TYPE)
- return fold (convert_to_char (type, expr));
if (code == POINTER_TYPE)
return fold (convert_to_pointer (type, expr));
error ("conversion to non-scalar type requested");
@@ -160,18 +158,6 @@ convert (tree type, tree expr)
}
-tree
-convert_to_char (tree type, tree expr)
-{
- return build1 (NOP_EXPR, type, expr);
-}
-
-tree
-convert_to_boolean (tree type, tree expr)
-{
- return build1 (NOP_EXPR, type, expr);
-}
-
/* Return a data type that has machine mode MODE.
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */
OpenPOWER on IntegriCloud