Commit 662986f2 by Tibor den Ouden Committed by Commit Bot

Implement dynamic cast to TIntermBranch * on TIntermNode

On the TIntermNode class there is no Derived *getAsDerived() for TIntermBranch. This is needed for the shader debugger to determine the node type. BUG=angleproject:1320 Change-Id: I9ce07017ccdb206c06c296b003b31eab6c65653c Reviewed-on: https://chromium-review.googlesource.com/328281 Tryjob-Request: Tibor Ouden, den <tibordenouden@gmail.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 24a504ec
...@@ -41,6 +41,7 @@ class TIntermLoop; ...@@ -41,6 +41,7 @@ class TIntermLoop;
class TInfoSink; class TInfoSink;
class TInfoSinkBase; class TInfoSinkBase;
class TIntermRaw; class TIntermRaw;
class TIntermBranch;
class TSymbolTable; class TSymbolTable;
...@@ -96,6 +97,7 @@ class TIntermNode : angle::NonCopyable ...@@ -96,6 +97,7 @@ class TIntermNode : angle::NonCopyable
virtual TIntermSymbol *getAsSymbolNode() { return 0; } virtual TIntermSymbol *getAsSymbolNode() { return 0; }
virtual TIntermLoop *getAsLoopNode() { return 0; } virtual TIntermLoop *getAsLoopNode() { return 0; }
virtual TIntermRaw *getAsRawNode() { return 0; } virtual TIntermRaw *getAsRawNode() { return 0; }
virtual TIntermBranch *getAsBranchNode() { return 0; }
// Replace a child node. Return true if |original| is a child // Replace a child node. Return true if |original| is a child
// node and it is replaced; otherwise, return false. // node and it is replaced; otherwise, return false.
...@@ -215,6 +217,7 @@ class TIntermBranch : public TIntermNode ...@@ -215,6 +217,7 @@ class TIntermBranch : public TIntermNode
mExpression(e) { } mExpression(e) { }
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
TIntermBranch *getAsBranchNode() override { return this; }
bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override; bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
TOperator getFlowOp() { return mFlowOp; } TOperator getFlowOp() { return mFlowOp; }
......
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