HLSL: phase 2c: use lValueErrorCheck in HLSL FE

This commit splits lValueErrorCheck into machine dependent and independent
parts.  The GLSL form in TParseContext inherits from and invokes the
machine dependent part in TParseContextBase.  The base form checks language
independent things.  This split does not change the set of errors tested
for: the test results are identical.

The new base class interface is now used from the HLSL FE to test lvalues.
There was one test diff due to this, where the test was writing to a uniform.
It still does the same indirections, but does not attempt a uniform write.
This commit is contained in:
steve-lunarg 2016-10-08 10:54:52 -06:00
parent 90707966ea
commit 0de16da2c0
7 changed files with 222 additions and 130 deletions

View file

@ -143,6 +143,9 @@ public:
virtual void growGlobalUniformBlock(TSourceLoc&, TType&, TString& memberName);
virtual bool insertGlobalUniformBlock();
virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
protected:
TParseContextBase(TParseContextBase&);
TParseContextBase& operator=(TParseContextBase&);
@ -278,8 +281,8 @@ public:
void unaryOpError(const TSourceLoc&, const char* op, TString operand);
void binaryOpError(const TSourceLoc&, const char* op, TString left, TString right);
void variableCheck(TIntermTyped*& nodePtr);
bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
void constantValueCheck(TIntermTyped* node, const char* token);
void integerCheck(const TIntermTyped* node, const char* token);
void globalCheck(const TSourceLoc&, const char* token);