Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / compiler / translator / RewriteElseBlocks.h
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:
21       ElseBlockRewriter()
22           : TIntermTraverser(false, false, true, false)
23           , mTemporaryIndex(0)
24       {}
25
26   protected:
27     bool visitAggregate(Visit visit, TIntermAggregate *aggregate);
28
29   private:
30     int mTemporaryIndex;
31
32     TIntermNode *rewriteSelection(TIntermSelection *selection);
33 };
34
35 void RewriteElseBlocks(TIntermNode *node);
36
37 }
38
39 #endif // COMPILER_REWRITE_ELSE_BLOCKS_H_