diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.gz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.lz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.xz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp')
-rwxr-xr-x | gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp | 31 |
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 |