Some rationalization of TIntermediate (to own it's own tree root) and TParseHelper for better encapsulation. Needed by some upcoming intra-stage link validation.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22914 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-09-03 22:57:27 +00:00
parent 807b8e3b82
commit 2f1eb37d82
8 changed files with 107 additions and 82 deletions

View file

@ -37,9 +37,10 @@
#include "../Include/intermediate.h"
#include "../Public/ShaderLang.h"
#include "SymbolTable.h"
#include "Versions.h"
class TInfoSink;
namespace glslang {
struct TVectorFields {
@ -47,14 +48,19 @@ struct TVectorFields {
int num;
};
class TSymbolTable;
class TVariable;
//
// Set of helper functions to help parse and build the tree.
//
class TIntermediate {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
public:
TIntermediate(int v, EProfile p) : treeRoot(0), profile(p), version(v) { }
TIntermediate(int v, EProfile p) : version(v), profile(p) { }
void setTreeRoot(TIntermNode* r) { treeRoot = r; }
TIntermNode* getTreeRoot() const { return treeRoot; }
TIntermSymbol* addSymbol(int Id, const TString&, const TType&, TSourceLoc);
TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*);
TIntermTyped* addBinaryMath(TOperator, TIntermTyped* left, TIntermTyped* right, TSourceLoc);
@ -86,10 +92,12 @@ public:
void addSymbolLinkageNodes(TIntermNode* root, TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&);
void addSymbolLinkageNode(TIntermAggregate*& linkage, const TVariable&);
void remove(TIntermNode*);
void outputTree(TIntermNode*, TInfoSink&);
void outputTree(TInfoSink& infoSink);
void removeTree();
protected:
TIntermNode* treeRoot;
EProfile profile;
int version;