aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-convert.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-08-28 20:21:21 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2021-08-29 17:19:02 +0200
commitce15a3e757c3a0adc611d907a3d4ba00c243a8f0 (patch)
treef049e0d05bc945f6caaaf3bd0a1fd8d056a05a40 /gcc/d/d-convert.cc
parent1925e514b4abb0c393cd729dde7e63c2b302cea5 (diff)
downloadgcc-ce15a3e757c3a0adc611d907a3d4ba00c243a8f0.zip
gcc-ce15a3e757c3a0adc611d907a3d4ba00c243a8f0.tar.gz
gcc-ce15a3e757c3a0adc611d907a3d4ba00c243a8f0.tar.bz2
d: Convert convert_for_rvalue switch statement into if condition
gcc/d/ChangeLog: * d-convert.cc (convert_for_rvalue): Convert switch statement into if condition.
Diffstat (limited to 'gcc/d/d-convert.cc')
-rw-r--r--gcc/d/d-convert.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc
index d43485d..3b47902 100644
--- a/gcc/d/d-convert.cc
+++ b/gcc/d/d-convert.cc
@@ -613,9 +613,8 @@ convert_for_rvalue (tree expr, Type *etype, Type *totype)
Type *ebtype = etype->toBasetype ();
Type *tbtype = totype->toBasetype ();
- switch (ebtype->ty)
+ if (ebtype->ty == Tbool)
{
- case Tbool:
/* If casting from bool, the result is either 0 or 1, any other value
violates @safe code, so enforce that it is never invalid. */
if (CONSTANT_CLASS_P (expr))
@@ -633,7 +632,6 @@ convert_for_rvalue (tree expr, Type *etype, Type *totype)
}
result = convert (build_ctype (tbtype), result);
- break;
}
return result ? result : convert_expr (expr, etype, totype);