zenilib  0.5.3.0
 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 
8 
9 void TDependencyGraphOutput::outputIndentation()
10 {
11  for (int i = 0; i < getDepth(); ++i)
12  mSink << " ";
13 }
14 
16 {
17  outputIndentation();
18  mSink << "argument " << parameter->getArgumentNumber() << " of call to "
19  << parameter->getIntermFunctionCall()->getName() << "\n";
20 }
21 
23 {
24  outputIndentation();
25  mSink << "function call " << functionCall->getIntermFunctionCall()->getName() << "\n";
26 }
27 
29 {
30  outputIndentation();
31  mSink << symbol->getIntermSymbol()->getSymbol() << " (symbol id: "
32  << symbol->getIntermSymbol()->getId() << ")\n";
33 }
34 
36 {
37  outputIndentation();
38  mSink << "selection\n";
39 }
40 
42 {
43  outputIndentation();
44  mSink << "loop condition\n";
45 }
46 
48 {
49  outputIndentation();
50  mSink << "logical " << logicalOp->getOpString() << "\n";
51 }
52 
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 }
virtual void traverse(TDependencyGraphTraverser *graphTraverser)
virtual void visitSelection(TGraphSelection *selection)
int getId() const
Definition: intermediate.h:348
virtual void visitArgument(TGraphArgument *parameter)
const TIntermSymbol * getIntermSymbol() const
virtual void visitLogicalOp(TGraphLogicalOp *logicalOp)
int getArgumentNumber() const
const TIntermAggregate * getIntermFunctionCall() const
void outputAllSpanningTrees(TDependencyGraph &graph)
TGraphNodeVector::const_iterator begin() const
virtual void visitFunctionCall(TGraphFunctionCall *functionCall)
const TString & getName() const
Definition: intermediate.h:472
virtual void visitLoop(TGraphLoop *loop)
virtual void visitSymbol(TGraphSymbol *symbol)
const TIntermAggregate * getIntermFunctionCall() const
const TString & getSymbol() const
Definition: intermediate.h:349
int i
Definition: pngrutil.c:1377
const char * getOpString() const
TGraphNodeVector::const_iterator end() const