zenilib: zenilib/jni/external/angle/src/compiler/depgraph/DependencyGraphOutput.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
DependencyGraphOutput.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/DependencyGraphOutput.h"
8
9 void TDependencyGraphOutput::outputIndentation()
10 {
11 for (int i = 0; i < getDepth(); ++i)
12 mSink << " ";
13 }
14
15 void TDependencyGraphOutput::visitArgument(TGraphArgument* parameter)
16 {
17 outputIndentation();
18 mSink << "argument " << parameter->getArgumentNumber() << " of call to "
19 << parameter->getIntermFunctionCall()->getName() << "\n";
20 }
21
22 void TDependencyGraphOutput::visitFunctionCall(TGraphFunctionCall* functionCall)
23 {
24 outputIndentation();
25 mSink << "function call " << functionCall->getIntermFunctionCall()->getName() << "\n";
26 }
27
28 void TDependencyGraphOutput::visitSymbol(TGraphSymbol* symbol)
29 {
30 outputIndentation();
31 mSink << symbol->getIntermSymbol()->getSymbol() << " (symbol id: "
32 << symbol->getIntermSymbol()->getId() << ")\n";
33 }
34
35 void TDependencyGraphOutput::visitSelection(TGraphSelection* selection)
36 {
37 outputIndentation();
38 mSink << "selection\n";
39 }
40
41 void TDependencyGraphOutput::visitLoop(TGraphLoop* loop)
42 {
43 outputIndentation();
44 mSink << "loop condition\n";
45 }
46
47 void TDependencyGraphOutput::visitLogicalOp(TGraphLogicalOp* logicalOp)
48 {
49 outputIndentation();
50 mSink << "logical " << logicalOp->getOpString() << "\n";
51 }
52
53 void TDependencyGraphOutput::outputAllSpanningTrees(TDependencyGraph& graph)
54 {
55 mSink << "\n";
56
57 for (TGraphNodeVector::const_iterator iter = graph.begin(); iter != graph.end(); ++iter)
58 {
59 TGraphNode* symbol = *iter;
60 mSink << "--- Dependency graph spanning tree ---\n";
61 clearVisited();
62 symbol->traverse(this);
63 mSink << "\n";
64 }
65 }
TGraphNode::traverse
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
Definition: DependencyGraphTraverse.cpp:11
TDependencyGraphOutput::visitSelection
virtual void visitSelection(TGraphSelection *selection)
Definition: DependencyGraphOutput.cpp:35
TIntermSymbol::getId
int getId() const
Definition: intermediate.h:348
TDependencyGraphOutput::visitArgument
virtual void visitArgument(TGraphArgument *parameter)
Definition: DependencyGraphOutput.cpp:15
TGraphArgument
Definition: DependencyGraph.h:59
DependencyGraphOutput.h
TGraphSymbol::getIntermSymbol
const TIntermSymbol * getIntermSymbol() const
Definition: DependencyGraph.h:91
TDependencyGraphOutput::visitLogicalOp
virtual void visitLogicalOp(TGraphLogicalOp *logicalOp)
Definition: DependencyGraphOutput.cpp:47
TGraphArgument::getArgumentNumber
int getArgumentNumber() const
Definition: DependencyGraph.h:66
TGraphArgument::getIntermFunctionCall
const TIntermAggregate * getIntermFunctionCall() const
Definition: DependencyGraph.h:65
TGraphSelection
Definition: DependencyGraph.h:98
TGraphSymbol
Definition: DependencyGraph.h:87
TDependencyGraphOutput::outputAllSpanningTrees
void outputAllSpanningTrees(TDependencyGraph &graph)
Definition: DependencyGraphOutput.cpp:53
TGraphLogicalOp
Definition: DependencyGraph.h:120
TDependencyGraph::begin
TGraphNodeVector::const_iterator begin() const
Definition: DependencyGraph.h:143
TGraphLoop
Definition: DependencyGraph.h:109
TDependencyGraphOutput::visitFunctionCall
virtual void visitFunctionCall(TGraphFunctionCall *functionCall)
Definition: DependencyGraphOutput.cpp:22
TIntermAggregate::getName
const TString & getName() const
Definition: intermediate.h:472
TDependencyGraph
Definition: DependencyGraph.h:139
TGraphNode
Definition: DependencyGraph.h:34
TGraphFunctionCall
Definition: DependencyGraph.h:75
TDependencyGraphOutput::visitLoop
virtual void visitLoop(TGraphLoop *loop)
Definition: DependencyGraphOutput.cpp:41
TDependencyGraphTraverser::clearVisited
void clearVisited()
Definition: DependencyGraph.h:204
TDependencyGraphOutput::visitSymbol
virtual void visitSymbol(TGraphSymbol *symbol)
Definition: DependencyGraphOutput.cpp:28
TGraphFunctionCall::getIntermFunctionCall
const TIntermAggregate * getIntermFunctionCall() const
Definition: DependencyGraph.h:80
TDependencyGraphTraverser::getDepth
int getDepth() const
Definition: DependencyGraph.h:200
TIntermSymbol::getSymbol
const TString & getSymbol() const
Definition: intermediate.h:349
i
int i
Definition: pngrutil.c:1377
TGraphLogicalOp::getOpString
const char * getOpString() const
Definition: DependencyGraph.cpp:88
TDependencyGraph::end
TGraphNodeVector::const_iterator end() const
Definition: DependencyGraph.h:144