xref: /aosp_15_r20/external/angle/src/compiler/translator/tree_ops/hlsl/SeparateExpressionsReturningArrays.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 // SeparateExpressionsReturningArrays splits array-returning expressions that are not array names
7 // from more complex expressions, assigning them to a temporary variable a#.
8 // Examples where a, b and c are all arrays:
9 // (a = b) == (a = c) is split into a = b; type[n] a1 = a; a = c; type[n] a2 = a; a1 == a2;
10 // type d = type[n](...)[i]; is split into type[n] a1 = type[n](...); type d = a1[i];
11 
12 #ifndef COMPILER_TRANSLATOR_TREEOPS_HLSL_SEPARATEEXPRESSIONSRETURNINGARRAYS_H_
13 #define COMPILER_TRANSLATOR_TREEOPS_HLSL_SEPARATEEXPRESSIONSRETURNINGARRAYS_H_
14 
15 #include "common/angleutils.h"
16 
17 namespace sh
18 {
19 class TCompiler;
20 class TIntermNode;
21 class TSymbolTable;
22 
23 [[nodiscard]] bool SeparateExpressionsReturningArrays(TCompiler *compiler,
24                                                       TIntermNode *root,
25                                                       TSymbolTable *symbolTable);
26 }  // namespace sh
27 
28 #endif  // COMPILER_TRANSLATOR_TREEOPS_HLSL_SEPARATEEXPRESSIONSRETURNINGARRAYS_H_
29