Misc. constant-folding fixes: Check % for 0, mat(mat) constructor, index range checking (within constant objects). Also, rationalize addConst*() methods.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23973 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-11-08 21:47:56 +00:00
parent 6d7fe63d76
commit 0876a58203
9 changed files with 245 additions and 114 deletions

View file

@ -81,6 +81,7 @@ public:
void handlePragma(const char **tokens, int numTokens);
TIntermTyped* handleVariable(TSourceLoc, TSymbol* symbol, TString* string);
TIntermTyped* handleBracketDereference(TSourceLoc, TIntermTyped* base, TIntermTyped* index);
void checkIndex(TSourceLoc, const TType&, int& index);
void handleIndexLimits(TSourceLoc, TIntermTyped* base, TIntermTyped* index);
void handleInputArrayAccess(TSourceLoc, TIntermTyped* base);
void checkInputArrayConsistency(TSourceLoc, bool tailOnly = false);
@ -159,10 +160,10 @@ public:
void updateTypedDefaults(TSourceLoc, const TQualifier&, const TString* id);
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
TIntermNode* addSwitch(TSourceLoc, TIntermTyped* expression, TIntermAggregate* body);
TIntermTyped* addConstVectorNode(TVectorFields&, TIntermTyped*, TSourceLoc);
TIntermTyped* addConstMatrixNode(int , TIntermTyped*, TSourceLoc);
TIntermTyped* addConstArrayNode(int index, TIntermTyped* node, TSourceLoc);
TIntermTyped* addConstStruct(TString& , TIntermTyped*, TSourceLoc);
TIntermTyped* addConstVectorNode(TSourceLoc, TVectorFields&, TIntermTyped*);
TIntermTyped* addConstMatrixNode(TSourceLoc, int index, TIntermTyped*);
TIntermTyped* addConstArrayNode(TSourceLoc, int index, TIntermTyped* node);
TIntermTyped* addConstStruct(TSourceLoc, TString& , TIntermTyped*);
void updateMaxArraySize(TSourceLoc, TIntermNode*, int index);