Commit 33a5423f by John Kessenich

Still generate switch statement when WARNING about missing statements is given. …

Still generate switch statement when WARNING about missing statements is given. It was correct behave when this used to be an error, but not now that it is a warning. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@29279 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 2b20dcb6
......@@ -29,7 +29,14 @@ ERROR: node is still EOpNull!
0:11 'f' (highp float)
0:14 'a' (2-element array of mediump int)
0:17 'c' (uniform mediump int)
0:21 'c' (uniform mediump int)
0:21 switch
0:21 condition
0:21 'c' (uniform mediump int)
0:21 body
0:21 Sequence
0:23 case: with expression
0:23 Constant:
0:23 2 (const int)
0:26 switch
0:26 condition
0:26 'c' (uniform mediump int)
......@@ -286,8 +293,13 @@ ERROR: node is still EOpNull!
0:124 Constant:
0:124 0 (const int)
0:126 'onlyInSwitch' (float)
0:128 Constant:
0:128 0 (const int)
0:128 switch
0:128 condition
0:128 Constant:
0:128 0 (const int)
0:128 body
0:128 Sequence
0:129 default:
0:133 switch
0:133 condition
0:133 'c' (uniform mediump int)
......@@ -348,7 +360,14 @@ ERROR: node is still EOpNull!
0:11 'f' (highp float)
0:14 'a' (2-element array of mediump int)
0:17 'c' (uniform mediump int)
0:21 'c' (uniform mediump int)
0:21 switch
0:21 condition
0:21 'c' (uniform mediump int)
0:21 body
0:21 Sequence
0:23 case: with expression
0:23 Constant:
0:23 2 (const int)
0:26 switch
0:26 condition
0:26 'c' (uniform mediump int)
......@@ -605,8 +624,13 @@ ERROR: node is still EOpNull!
0:124 Constant:
0:124 0 (const int)
0:126 'onlyInSwitch' (float)
0:128 Constant:
0:128 0 (const int)
0:128 switch
0:128 condition
0:128 Constant:
0:128 0 (const int)
0:128 body
0:128 Sequence
0:129 default:
0:133 switch
0:133 condition
0:133 'c' (uniform mediump int)
......
......@@ -5037,12 +5037,9 @@ TIntermNode* TParseContext::addSwitch(TSourceLoc loc, TIntermTyped* expression,
if (switchSequence->size() == 0)
return expression;
if (lastStatements == 0) {
if (lastStatements == 0)
warn(loc, "last case/default label not followed by statements", "switch", "");
return expression;
}
TIntermAggregate* body = new TIntermAggregate(EOpSequence);
body->getSequence() = *switchSequenceStack.back();
body->setLoc(loc);
......
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