LCOV - code coverage report
Current view: top level - gfx/angle/src/compiler/translator - NodeSearch.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 16 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 9 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //
       2             : // Copyright (c) 2002-2013 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             : // NodeSearch.h: Utilities for searching translator node graphs
       7             : //
       8             : 
       9             : #ifndef COMPILER_TRANSLATOR_NODESEARCH_H_
      10             : #define COMPILER_TRANSLATOR_NODESEARCH_H_
      11             : 
      12             : #include "compiler/translator/IntermNode.h"
      13             : 
      14             : namespace sh
      15             : {
      16             : 
      17             : template <class Parent>
      18           0 : class NodeSearchTraverser : public TIntermTraverser
      19             : {
      20             :   public:
      21           0 :     NodeSearchTraverser()
      22             :         : TIntermTraverser(true, false, false),
      23           0 :           mFound(false)
      24           0 :     {}
      25             : 
      26           0 :     bool found() const { return mFound; }
      27             : 
      28           0 :     static bool search(TIntermNode *node)
      29             :     {
      30           0 :         Parent searchTraverser;
      31           0 :         node->traverse(&searchTraverser);
      32           0 :         return searchTraverser.found();
      33             :     }
      34             : 
      35             :   protected:
      36             :     bool mFound;
      37             : };
      38             : 
      39           0 : class FindDiscard : public NodeSearchTraverser<FindDiscard>
      40             : {
      41             :   public:
      42           0 :     virtual bool visitBranch(Visit visit, TIntermBranch *node)
      43             :     {
      44           0 :         switch (node->getFlowOp())
      45             :         {
      46             :           case EOpKill:
      47           0 :             mFound = true;
      48           0 :             break;
      49             : 
      50           0 :           default: break;
      51             :         }
      52             : 
      53           0 :         return !mFound;
      54             :     }
      55             : };
      56             : 
      57             : }
      58             : 
      59             : #endif // COMPILER_TRANSLATOR_NODESEARCH_H_

Generated by: LCOV version 1.13