mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 13:40:11 +03:00
expressionsem.d: Combine redundant branches (#20796)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
This commit is contained in:
parent
c3da7f0747
commit
84c7b040b0
1 changed files with 6 additions and 30 deletions
|
@ -12127,10 +12127,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp.suggestBinaryOverloads(sc))
|
if (exp.suggestBinaryOverloads(sc) || exp.checkArithmeticBin())
|
||||||
return setError();
|
|
||||||
|
|
||||||
if (exp.checkArithmeticBin())
|
|
||||||
return setError();
|
return setError();
|
||||||
|
|
||||||
tb1 = exp.e1.type.toBasetype();
|
tb1 = exp.e1.type.toBasetype();
|
||||||
|
@ -12283,10 +12280,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp.suggestBinaryOverloads(sc))
|
if (exp.suggestBinaryOverloads(sc) || exp.checkArithmeticBin())
|
||||||
return setError();
|
|
||||||
|
|
||||||
if (exp.checkArithmeticBin())
|
|
||||||
return setError();
|
return setError();
|
||||||
|
|
||||||
t1 = exp.e1.type.toBasetype();
|
t1 = exp.e1.type.toBasetype();
|
||||||
|
@ -12587,7 +12581,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
trySetCatExpLowering(result);
|
trySetCatExpLowering(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool commonBinOpSemantic(BinExp exp)
|
bool commonArithBinOpSemantic(BinExp exp)
|
||||||
{
|
{
|
||||||
if (Expression e = exp.opOverloadBinary(sc, aliasThisStop))
|
if (Expression e = exp.opOverloadBinary(sc, aliasThisStop))
|
||||||
{
|
{
|
||||||
|
@ -12600,12 +12594,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
result = ex;
|
result = ex;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool commonArithBinOpSemantic(BinExp exp)
|
|
||||||
{
|
|
||||||
if (commonBinOpSemantic(exp))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
Type tb = exp.type.toBasetype();
|
Type tb = exp.type.toBasetype();
|
||||||
if (tb.ty == Tarray || tb.ty == Tsarray)
|
if (tb.ty == Tarray || tb.ty == Tsarray)
|
||||||
|
@ -12619,13 +12607,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp.suggestBinaryOverloads(sc))
|
if (exp.suggestBinaryOverloads(sc) || exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
|
||||||
{
|
|
||||||
setError();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exp.checkArithmeticBin() || exp.checkSharedAccessBin(sc))
|
|
||||||
{
|
{
|
||||||
setError();
|
setError();
|
||||||
return true;
|
return true;
|
||||||
|
@ -12839,10 +12821,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp.suggestBinaryOverloads(sc))
|
if (exp.suggestBinaryOverloads(sc) || exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
|
||||||
return setError();
|
|
||||||
|
|
||||||
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
|
|
||||||
return setError();
|
return setError();
|
||||||
|
|
||||||
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
|
if (!target.isVectorOpSupported(exp.e1.type.toBasetype(), exp.op, exp.e2.type.toBasetype()))
|
||||||
|
@ -12913,10 +12892,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp.suggestBinaryOverloads(sc))
|
if (exp.suggestBinaryOverloads(sc) || exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
|
||||||
return setError();
|
|
||||||
|
|
||||||
if (exp.checkIntegralBin() || exp.checkSharedAccessBin(sc))
|
|
||||||
return setError();
|
return setError();
|
||||||
|
|
||||||
result = exp;
|
result = exp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue