gfx/angle/src/compiler/depgraph/DependencyGraphOutput.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/compiler/depgraph/DependencyGraphOutput.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +//
     1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +#include "compiler/depgraph/DependencyGraphOutput.h"
    1.11 +
    1.12 +void TDependencyGraphOutput::outputIndentation()
    1.13 +{
    1.14 +    for (int i = 0; i < getDepth(); ++i)
    1.15 +        mSink << "  ";
    1.16 +}
    1.17 +
    1.18 +void TDependencyGraphOutput::visitArgument(TGraphArgument* parameter)
    1.19 +{
    1.20 +    outputIndentation();
    1.21 +    mSink << "argument " << parameter->getArgumentNumber() << " of call to "
    1.22 +          << parameter->getIntermFunctionCall()->getName() << "\n";
    1.23 +}
    1.24 +
    1.25 +void TDependencyGraphOutput::visitFunctionCall(TGraphFunctionCall* functionCall)
    1.26 +{
    1.27 +    outputIndentation();
    1.28 +    mSink << "function call " <<  functionCall->getIntermFunctionCall()->getName() << "\n";
    1.29 +}
    1.30 +
    1.31 +void TDependencyGraphOutput::visitSymbol(TGraphSymbol* symbol)
    1.32 +{
    1.33 +    outputIndentation();
    1.34 +    mSink << symbol->getIntermSymbol()->getSymbol() << " (symbol id: "
    1.35 +          << symbol->getIntermSymbol()->getId() << ")\n";
    1.36 +}
    1.37 +
    1.38 +void TDependencyGraphOutput::visitSelection(TGraphSelection* selection)
    1.39 +{
    1.40 +    outputIndentation();
    1.41 +    mSink << "selection\n";
    1.42 +}
    1.43 +
    1.44 +void TDependencyGraphOutput::visitLoop(TGraphLoop* loop)
    1.45 +{
    1.46 +    outputIndentation();
    1.47 +    mSink << "loop condition\n";
    1.48 +}
    1.49 +
    1.50 +void TDependencyGraphOutput::visitLogicalOp(TGraphLogicalOp* logicalOp)
    1.51 +{
    1.52 +    outputIndentation();
    1.53 +    mSink << "logical " << logicalOp->getOpString() << "\n";
    1.54 +}
    1.55 +
    1.56 +void TDependencyGraphOutput::outputAllSpanningTrees(TDependencyGraph& graph)
    1.57 +{
    1.58 +    mSink << "\n";
    1.59 +
    1.60 +    for (TGraphNodeVector::const_iterator iter = graph.begin(); iter != graph.end(); ++iter)
    1.61 +    {
    1.62 +        TGraphNode* symbol = *iter;
    1.63 +        mSink << "--- Dependency graph spanning tree ---\n";
    1.64 +        clearVisited();
    1.65 +        symbol->traverse(this);
    1.66 +        mSink << "\n";
    1.67 +    }
    1.68 +}

mercurial