Olli Etuaho | bb5a7e2 | 2017-08-30 13:03:12 +0300 | [diff] [blame^] | 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 | namespace sh |
| 21 | { |
| 22 | |
| 23 | class TIntermBlock; |
| 24 | |
| 25 | void RemoveArrayLengthMethod(TIntermBlock *root); |
| 26 | |
| 27 | } // namespace sh |