Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / compiler / translator / Intermediate.cpp
index a0bdba2..f139fc2 100644 (file)
@@ -759,6 +759,26 @@ bool TIntermLoop::replaceChildNode(
     return false;
 }
 
+void TIntermLoop::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    if (init)
+    {
+        nodeQueue->push(init);
+    }
+    if (cond)
+    {
+        nodeQueue->push(cond);
+    }
+    if (expr)
+    {
+        nodeQueue->push(expr);
+    }
+    if (body)
+    {
+        nodeQueue->push(body);
+    }
+}
+
 bool TIntermBranch::replaceChildNode(
     TIntermNode *original, TIntermNode *replacement)
 {
@@ -766,6 +786,14 @@ bool TIntermBranch::replaceChildNode(
     return false;
 }
 
+void TIntermBranch::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    if (expression)
+    {
+        nodeQueue->push(expression);
+    }
+}
+
 bool TIntermBinary::replaceChildNode(
     TIntermNode *original, TIntermNode *replacement)
 {
@@ -774,6 +802,18 @@ bool TIntermBinary::replaceChildNode(
     return false;
 }
 
+void TIntermBinary::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    if (left)
+    {
+        nodeQueue->push(left);
+    }
+    if (right)
+    {
+        nodeQueue->push(right);
+    }
+}
+
 bool TIntermUnary::replaceChildNode(
     TIntermNode *original, TIntermNode *replacement)
 {
@@ -781,6 +821,14 @@ bool TIntermUnary::replaceChildNode(
     return false;
 }
 
+void TIntermUnary::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    if (operand)
+    {
+        nodeQueue->push(operand);
+    }
+}
+
 bool TIntermAggregate::replaceChildNode(
     TIntermNode *original, TIntermNode *replacement)
 {
@@ -791,6 +839,14 @@ bool TIntermAggregate::replaceChildNode(
     return false;
 }
 
+void TIntermAggregate::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    for (size_t childIndex = 0; childIndex < sequence.size(); childIndex++)
+    {
+        nodeQueue->push(sequence[childIndex]);
+    }
+}
+
 bool TIntermSelection::replaceChildNode(
     TIntermNode *original, TIntermNode *replacement)
 {
@@ -800,6 +856,22 @@ bool TIntermSelection::replaceChildNode(
     return false;
 }
 
+void TIntermSelection::enqueueChildren(std::queue<TIntermNode*> *nodeQueue) const
+{
+    if (condition)
+    {
+        nodeQueue->push(condition);
+    }
+    if (trueBlock)
+    {
+        nodeQueue->push(trueBlock);
+    }
+    if (falseBlock)
+    {
+        nodeQueue->push(falseBlock);
+    }
+}
+
 //
 // Say whether or not an operation node changes the value of a variable.
 //