Jamie Madill | e53c98b | 2014-02-03 11:57:13 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 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 | // RewriteElseBlocks.h: Prototype for tree transform to change |
| 7 | // all if-else blocks to if-if blocks. |
| 8 | // |
| 9 | |
| 10 | #ifndef COMPILER_REWRITE_ELSE_BLOCKS_H_ |
| 11 | #define COMPILER_REWRITE_ELSE_BLOCKS_H_ |
| 12 | |
| 13 | #include "compiler/translator/intermediate.h" |
| 14 | |
| 15 | namespace sh |
| 16 | { |
| 17 | |
| 18 | class ElseBlockRewriter : public TIntermTraverser |
| 19 | { |
| 20 | public: |
Jamie Madill | ebba7d3 | 2014-07-07 12:49:45 -0400 | [diff] [blame] | 21 | ElseBlockRewriter(); |
Jamie Madill | e53c98b | 2014-02-03 11:57:13 -0500 | [diff] [blame] | 22 | |
| 23 | protected: |
| 24 | bool visitAggregate(Visit visit, TIntermAggregate *aggregate); |
| 25 | |
| 26 | private: |
| 27 | int mTemporaryIndex; |
Jamie Madill | ebba7d3 | 2014-07-07 12:49:45 -0400 | [diff] [blame] | 28 | const TType *mFunctionType; |
Jamie Madill | e53c98b | 2014-02-03 11:57:13 -0500 | [diff] [blame] | 29 | |
| 30 | TIntermNode *rewriteSelection(TIntermSelection *selection); |
| 31 | }; |
| 32 | |
| 33 | void RewriteElseBlocks(TIntermNode *node); |
| 34 | |
| 35 | } |
| 36 | |
| 37 | #endif // COMPILER_REWRITE_ELSE_BLOCKS_H_ |