Olli Etuaho | 822fa84 | 2015-04-16 14:26:10 +0300 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2015 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 | // The SeparateArrayInitialization function splits each array initialization into a declaration and an assignment. |
| 7 | // Example: |
| 8 | // type[n] a = initializer; |
| 9 | // will effectively become |
| 10 | // type[n] a; |
| 11 | // a = initializer; |
Olli Etuaho | b1edc4f | 2015-11-02 17:20:03 +0200 | [diff] [blame] | 12 | // |
| 13 | // Note that if the array is declared as const, the initialization is still split, making the AST |
| 14 | // technically invalid. Because of that this transformation should only be used when subsequent |
| 15 | // stages don't care about const qualifiers. |
Olli Etuaho | 822fa84 | 2015-04-16 14:26:10 +0300 | [diff] [blame] | 16 | |
| 17 | #ifndef COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_ |
| 18 | #define COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_ |
| 19 | |
| 20 | class TIntermNode; |
| 21 | |
| 22 | void SeparateArrayInitialization(TIntermNode *root); |
| 23 | |
| 24 | #endif // COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_ |