Infrastructure: Move nesting counters, etc., to base class.

This lets all languages share the same definitions.
This commit is contained in:
John Kessenich
2017-06-06 19:19:45 -06:00
parent b4d46627cb
commit 9b2531ba23
6 changed files with 33 additions and 32 deletions

View File

@@ -57,10 +57,7 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
const TString sourceEntryPointName,
bool forwardCompatible, EShMessages messages) :
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
contextPragma(true, false),
loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
postEntryPointReturn(false),
limits(resources.limits),
annotationNestingLevel(0),
inputPatch(nullptr),
builtInIoIndex(nullptr),
builtInIoBase(nullptr),
@@ -520,6 +517,9 @@ TIntermTyped* HlslParseContext::handleSamplerLvalue(const TSourceLoc& loc, const
return node;
}
if (controlFlowNestingLevel > 0)
error(loc, "can't alias sampler in control flow", op, "");
// Best is if we are aliasing a flattened struct member "S.s1 = s2",
// in which case we want to update the flattening information with the alias,
// making everything else work seamlessly.