summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 23:29:50 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 23:31:02 +0200
commit70dd5e7c66b1fe3f82e5b4db2406050baba15f05 (patch)
tree3f012200ef3c934f33db1a4ef2b790fae3141860 /gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
parent8481fa25d246f1968d0a254ee3c6cdd82c60781a (diff)
downloadUXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.gz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.lz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.xz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.zip
Merge branch 'ANGLE-rollback'
This resolves #624 Note: Cherry-picked some fixes on top of the ANGLE version that we want to keep.
Diffstat (limited to 'gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp')
-rwxr-xr-xgfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp31
1 files changed, 7 insertions, 24 deletions
diff --git a/gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp b/gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
index dd995af47..b278b5343 100755
--- a/gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
+++ b/gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
@@ -6,10 +6,7 @@
#include "compiler/translator/RemoveSwitchFallThrough.h"
-namespace sh
-{
-
-TIntermBlock *RemoveSwitchFallThrough::removeFallThrough(TIntermBlock *statementList)
+TIntermAggregate *RemoveSwitchFallThrough::removeFallThrough(TIntermAggregate *statementList)
{
RemoveSwitchFallThrough rm(statementList);
ASSERT(statementList);
@@ -25,13 +22,14 @@ TIntermBlock *RemoveSwitchFallThrough::removeFallThrough(TIntermBlock *statement
return rm.mStatementListOut;
}
-RemoveSwitchFallThrough::RemoveSwitchFallThrough(TIntermBlock *statementList)
+RemoveSwitchFallThrough::RemoveSwitchFallThrough(TIntermAggregate *statementList)
: TIntermTraverser(true, false, false),
mStatementList(statementList),
mLastStatementWasBreak(false),
mPreviousCase(nullptr)
{
- mStatementListOut = new TIntermBlock();
+ mStatementListOut = new TIntermAggregate();
+ mStatementListOut->setOp(EOpSequence);
}
void RemoveSwitchFallThrough::visitSymbol(TIntermSymbol *node)
@@ -64,14 +62,7 @@ bool RemoveSwitchFallThrough::visitUnary(Visit, TIntermUnary *node)
return false;
}
-bool RemoveSwitchFallThrough::visitTernary(Visit, TIntermTernary *node)
-{
- mPreviousCase->getSequence()->push_back(node);
- mLastStatementWasBreak = false;
- return false;
-}
-
-bool RemoveSwitchFallThrough::visitIfElse(Visit, TIntermIfElse *node)
+bool RemoveSwitchFallThrough::visitSelection(Visit, TIntermSelection *node)
{
mPreviousCase->getSequence()->push_back(node);
mLastStatementWasBreak = false;
@@ -132,7 +123,8 @@ void RemoveSwitchFallThrough::handlePreviousCase()
bool RemoveSwitchFallThrough::visitCase(Visit, TIntermCase *node)
{
handlePreviousCase();
- mPreviousCase = new TIntermBlock();
+ mPreviousCase = new TIntermAggregate();
+ mPreviousCase->setOp(EOpSequence);
mPreviousCase->getSequence()->push_back(node);
// Don't traverse the condition of the case statement
return false;
@@ -140,13 +132,6 @@ bool RemoveSwitchFallThrough::visitCase(Visit, TIntermCase *node)
bool RemoveSwitchFallThrough::visitAggregate(Visit, TIntermAggregate *node)
{
- mPreviousCase->getSequence()->push_back(node);
- mLastStatementWasBreak = false;
- return false;
-}
-
-bool RemoveSwitchFallThrough::visitBlock(Visit, TIntermBlock *node)
-{
if (node != mStatementList)
{
mPreviousCase->getSequence()->push_back(node);
@@ -170,5 +155,3 @@ bool RemoveSwitchFallThrough::visitBranch(Visit, TIntermBranch *node)
mLastStatementWasBreak = true;
return false;
}
-
-} // namespace sh