Code simplification: Add (and use) helper functions for building constant scalar AST nodes for bool, int, uint, float, and double, shortening all the code segments that were doing that.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26600 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2014-05-10 19:52:01 +00:00
parent a92c30ed23
commit 7c257eb108
4 changed files with 65 additions and 70 deletions

View file

@ -157,6 +157,10 @@ public:
TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc);
TIntermTyped* addMethod(TIntermTyped*, const TType&, const TString*, TSourceLoc);
TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, TSourceLoc, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(int, TSourceLoc, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(unsigned int, TSourceLoc, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(bool, TSourceLoc, bool literal = false) const;
TIntermConstantUnion* addConstantUnion(double, TBasicType, TSourceLoc, bool literal = false) const;
TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const;
bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false);
TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, TSourceLoc);