xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/hlsl/UnfoldShortCircuitToIf.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2002 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 // UnfoldShortCircuitToIf is an AST traverser to convert short-circuiting operators to if-else
7 // statements.
8 // The results are assigned to s# temporaries, which are used by the main translator instead of
9 // the original expression.
10 //
11 
12 #ifndef COMPILER_TRANSLATOR_TREEOPS_HLSL_UNFOLDSHORTCIRCUIT_H_
13 #define COMPILER_TRANSLATOR_TREEOPS_HLSL_UNFOLDSHORTCIRCUIT_H_
14 
15 #include "common/angleutils.h"
16 
17 namespace sh
18 {
19 
20 class TCompiler;
21 class TIntermNode;
22 class TSymbolTable;
23 
24 [[nodiscard]] bool UnfoldShortCircuitToIf(TCompiler *compiler,
25                                           TIntermNode *root,
26                                           TSymbolTable *symbolTable);
27 
28 }  // namespace sh
29 
30 #endif  // COMPILER_TRANSLATOR_TREEOPS_HLSL_UNFOLDSHORTCIRCUIT_H_
31