• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 #include "compiler/translator/IntermNode.h"
8 #include "compiler/translator/RemoveTree.h"
9 
10 //
11 // Code to delete the intermediate tree.
12 //
RemoveAllTreeNodes(TIntermNode * root)13 void RemoveAllTreeNodes(TIntermNode* root)
14 {
15     std::queue<TIntermNode*> nodeQueue;
16 
17     nodeQueue.push(root);
18 
19     while (!nodeQueue.empty())
20     {
21         TIntermNode *node = nodeQueue.front();
22         nodeQueue.pop();
23 
24         node->enqueueChildren(&nodeQueue);
25 
26         delete node;
27     }
28 }
29 
30