gfx/angle/src/compiler/UnfoldShortCircuit.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/compiler/UnfoldShortCircuit.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-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 +// UnfoldShortCircuit is an AST traverser to output short-circuiting operators as if-else statements
    1.10 +//
    1.11 +
    1.12 +#ifndef COMPILER_UNFOLDSHORTCIRCUIT_H_
    1.13 +#define COMPILER_UNFOLDSHORTCIRCUIT_H_
    1.14 +
    1.15 +#include "compiler/intermediate.h"
    1.16 +#include "compiler/ParseHelper.h"
    1.17 +
    1.18 +namespace sh
    1.19 +{
    1.20 +class OutputHLSL;
    1.21 +
    1.22 +class UnfoldShortCircuit : public TIntermTraverser
    1.23 +{
    1.24 +  public:
    1.25 +    UnfoldShortCircuit(TParseContext &context, OutputHLSL *outputHLSL);
    1.26 +
    1.27 +    void traverse(TIntermNode *node);
    1.28 +    bool visitBinary(Visit visit, TIntermBinary*);
    1.29 +    bool visitSelection(Visit visit, TIntermSelection *node);
    1.30 +    bool visitLoop(Visit visit, TIntermLoop *node);
    1.31 +
    1.32 +    int getNextTemporaryIndex();
    1.33 +
    1.34 +  protected:
    1.35 +    TParseContext &mContext;
    1.36 +    OutputHLSL *const mOutputHLSL;
    1.37 +
    1.38 +    int mTemporaryIndex;
    1.39 +};
    1.40 +}
    1.41 +
    1.42 +#endif   // COMPILER_UNFOLDSHORTCIRCUIT_H_

mercurial