Commit ddb45f8d by John Kessenich Committed by GitHub

Merge pull request #1080 from hedejing/master

Add getAsLoopNode() method for TIntermLoop
parents bb79abcc fdbd0eba
...@@ -790,6 +790,7 @@ class TIntermBranch; ...@@ -790,6 +790,7 @@ class TIntermBranch;
class TIntermTyped; class TIntermTyped;
class TIntermMethod; class TIntermMethod;
class TIntermSymbol; class TIntermSymbol;
class TIntermLoop;
} // end namespace glslang } // end namespace glslang
...@@ -817,6 +818,7 @@ public: ...@@ -817,6 +818,7 @@ public:
virtual glslang::TIntermMethod* getAsMethodNode() { return 0; } virtual glslang::TIntermMethod* getAsMethodNode() { return 0; }
virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; } virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; }
virtual glslang::TIntermBranch* getAsBranchNode() { return 0; } virtual glslang::TIntermBranch* getAsBranchNode() { return 0; }
virtual glslang::TIntermLoop* getAsLoopNode() { return 0; }
virtual const glslang::TIntermTyped* getAsTyped() const { return 0; } virtual const glslang::TIntermTyped* getAsTyped() const { return 0; }
virtual const glslang::TIntermOperator* getAsOperator() const { return 0; } virtual const glslang::TIntermOperator* getAsOperator() const { return 0; }
...@@ -829,6 +831,7 @@ public: ...@@ -829,6 +831,7 @@ public:
virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; } virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; }
virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; } virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; }
virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; } virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; }
virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; }
virtual ~TIntermNode() { } virtual ~TIntermNode() { }
protected: protected:
...@@ -910,6 +913,8 @@ public: ...@@ -910,6 +913,8 @@ public:
control(ELoopControlNone) control(ELoopControlNone)
{ } { }
virtual TIntermLoop* getAsLoopNode() { return this; }
virtual const TIntermLoop* getAsLoopNode() const { return this; }
virtual void traverse(TIntermTraverser*); virtual void traverse(TIntermTraverser*);
TIntermNode* getBody() const { return body; } TIntermNode* getBody() const { return body; }
TIntermTyped* getTest() const { return test; } TIntermTyped* getTest() const { return test; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment