zenilib: zenilib/jni/external/angle/src/compiler/depgraph/DependencyGraphTraverse.cpp Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DependencyGraphTraverse.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2012 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/depgraph/DependencyGraph.h"
8
9 // These methods do a breadth-first traversal through the graph and mark visited nodes.
10
11 void TGraphNode::traverse(TDependencyGraphTraverser* graphTraverser)
12 {
13 graphTraverser->markVisited(this);
14 }
15
16 void TGraphParentNode::traverse(TDependencyGraphTraverser* graphTraverser)
17 {
18 TGraphNode::traverse(graphTraverser);
19
20 graphTraverser->incrementDepth();
21
22 // Visit the parent node's children.
23 for (TGraphNodeSet::const_iterator iter = mDependentNodes.begin();
24 iter != mDependentNodes.end();
25 ++iter)
26 {
27 TGraphNode* node = *iter;
28 if (!graphTraverser->isVisited(node))
29 node->traverse(graphTraverser);
30 }
31
32 graphTraverser->decrementDepth();
33 }
34
35 void TGraphArgument::traverse(TDependencyGraphTraverser* graphTraverser)
36 {
37 graphTraverser->visitArgument(this);
38 TGraphParentNode::traverse(graphTraverser);
39 }
40
41 void TGraphFunctionCall::traverse(TDependencyGraphTraverser* graphTraverser)
42 {
43 graphTraverser->visitFunctionCall(this);
44 TGraphParentNode::traverse(graphTraverser);
45 }
46
47 void TGraphSymbol::traverse(TDependencyGraphTraverser* graphTraverser)
48 {
49 graphTraverser->visitSymbol(this);
50 TGraphParentNode::traverse(graphTraverser);
51 }
52
53 void TGraphSelection::traverse(TDependencyGraphTraverser* graphTraverser)
54 {
55 graphTraverser->visitSelection(this);
56 TGraphNode::traverse(graphTraverser);
57 }
58
59 void TGraphLoop::traverse(TDependencyGraphTraverser* graphTraverser)
60 {
61 graphTraverser->visitLoop(this);
62 TGraphNode::traverse(graphTraverser);
63 }
64
65 void TGraphLogicalOp::traverse(TDependencyGraphTraverser* graphTraverser)
66 {
67 graphTraverser->visitLogicalOp(this);
68 TGraphNode::traverse(graphTraverser);
69 }
TGraphLogicalOp::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:65
TGraphNode::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:11
TDependencyGraphTraverser::visitSelection
virtual void visitSelection(TGraphSelection *selection)
Definition: DependencyGraph.h:196
TGraphSymbol::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:47
TDependencyGraphTraverser
Definition: DependencyGraph.h:189
DependencyGraph.h
TDependencyGraphTraverser::incrementDepth
void incrementDepth()
Definition: DependencyGraph.h:201
TDependencyGraphTraverser::isVisited
bool isVisited(TGraphNode *node) const
Definition: DependencyGraph.h:206
TGraphNode
Definition: DependencyGraph.h:34
TGraphFunctionCall::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:41
TDependencyGraphTraverser::markVisited
void markVisited(TGraphNode *node)
Definition: DependencyGraph.h:205
TGraphParentNode::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:16
TDependencyGraphTraverser::visitFunctionCall
virtual void visitFunctionCall(TGraphFunctionCall *functionCall)
Definition: DependencyGraph.h:195
TDependencyGraphTraverser::visitArgument
virtual void visitArgument(TGraphArgument *selection)
Definition: DependencyGraph.h:194
TGraphLoop::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:59
TDependencyGraphTraverser::visitLoop
virtual void visitLoop(TGraphLoop *loop)
Definition: DependencyGraph.h:197
TDependencyGraphTraverser::visitSymbol
virtual void visitSymbol(TGraphSymbol *symbol)
Definition: DependencyGraph.h:193
TDependencyGraphTraverser::visitLogicalOp
virtual void visitLogicalOp(TGraphLogicalOp *logicalOp)
Definition: DependencyGraph.h:198
TGraphSelection::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:53
TDependencyGraphTraverser::decrementDepth
void decrementDepth()
Definition: DependencyGraph.h:202
TGraphArgument::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:35