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
This commit is contained in:
John Kessenich 2014-12-21 16:48:29 +00:00
parent 2b20dcb64d
commit 33a5423f76
2 changed files with 31 additions and 10 deletions

View File

@ -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)

View File

@ -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);