Commit 8886f0fc by Olli Etuaho Committed by Commit Bot

Clean redundant semicolons from HLSL branch statements

Branch statements can only exist inside block nodes. The block node that contains a branch will take care of writing a semicolon after each statement. BUG=angleproject:1013 TEST=angle_end2end_tests Change-Id: Ie5d9077c5d2e090c704282dba39b4d46845cbf1e Reviewed-on: https://chromium-review.googlesource.com/708894Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 180f43c6
...@@ -2262,16 +2262,16 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node) ...@@ -2262,16 +2262,16 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node) bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
{ {
if (visit == PreVisit)
{
TInfoSinkBase &out = getInfoSink(); TInfoSinkBase &out = getInfoSink();
switch (node->getFlowOp()) switch (node->getFlowOp())
{ {
case EOpKill: case EOpKill:
outputTriplet(out, visit, "discard;\n", "", ""); out << "discard";
break; break;
case EOpBreak: case EOpBreak:
if (visit == PreVisit)
{
if (mNestedLoopDepth > 1) if (mNestedLoopDepth > 1)
{ {
mUsesNestedBreak = true; mUsesNestedBreak = true;
...@@ -2285,36 +2285,26 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node) ...@@ -2285,36 +2285,26 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
} }
else else
{ {
out << "break;\n"; out << "break";
}
} }
break; break;
case EOpContinue: case EOpContinue:
outputTriplet(out, visit, "continue;\n", "", ""); out << "continue";
break; break;
case EOpReturn: case EOpReturn:
if (visit == PreVisit)
{
if (node->getExpression()) if (node->getExpression())
{ {
out << "return "; out << "return ";
} }
else else
{ {
out << "return;\n"; out << "return";
}
}
else if (visit == PostVisit)
{
if (node->getExpression())
{
out << ";\n";
}
} }
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment