1//
2// Copyright (c) 2017 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// RemoveArrayLengthMethod.h:
7// Fold array length expressions, including cases where the "this" node has side effects.
8// Example:
9// int i = (a = b).length();
10// int j = (func()).length();
11// becomes:
12// (a = b);
13// int i = <constant array length>;
14// func();
15// int j = <constant array length>;
16//
17// Must be run after SplitSequenceOperator, SimplifyLoopConditions and SeparateDeclarations steps
18// have been done to expressions containing calls of the array length method.
19//
20// Does nothing to length method calls done on runtime-sized arrays.
21
22#ifndef COMPILER_TRANSLATOR_TREEOPS_REMOVEARRAYLENGTHMETHOD_H_
23#define COMPILER_TRANSLATOR_TREEOPS_REMOVEARRAYLENGTHMETHOD_H_
24
25namespace sh
26{
27
28class TIntermBlock;
29
30void RemoveArrayLengthMethod(TIntermBlock *root);
31
32} // namespace sh
33
34#endif // COMPILER_TRANSLATOR_TREEOPS_REMOVEARRAYLENGTHMETHOD_H_
35