Olli Etuaho | fc0e2bc | 2015-04-16 13:39:56 +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 | // |
Olli Etuaho | a6f2209 | 2015-05-08 18:31:10 +0300 | [diff] [blame] | 6 | // The SeparateDeclarations function processes declarations, so that in the end each declaration |
| 7 | // contains only one declarator. |
Jamie Madill | d7b1ab5 | 2016-12-12 14:42:19 -0500 | [diff] [blame] | 8 | // This is useful as an intermediate step when initialization needs to be separated from |
| 9 | // declaration, or when things need to be unfolded out of the initializer. |
Olli Etuaho | fc0e2bc | 2015-04-16 13:39:56 +0300 | [diff] [blame] | 10 | // Example: |
| 11 | // int a[1] = int[1](1), b[1] = int[1](2); |
| 12 | // gets transformed when run through this class into the AST equivalent of: |
| 13 | // int a[1] = int[1](1); |
| 14 | // int b[1] = int[1](2); |
| 15 | |
| 16 | #ifndef COMPILER_TRANSLATOR_SEPARATEDECLARATIONS_H_ |
| 17 | #define COMPILER_TRANSLATOR_SEPARATEDECLARATIONS_H_ |
| 18 | |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 19 | namespace sh |
| 20 | { |
Olli Etuaho | fc0e2bc | 2015-04-16 13:39:56 +0300 | [diff] [blame] | 21 | class TIntermNode; |
| 22 | |
Olli Etuaho | a6f2209 | 2015-05-08 18:31:10 +0300 | [diff] [blame] | 23 | void SeparateDeclarations(TIntermNode *root); |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame] | 24 | } // namespace sh |
Olli Etuaho | fc0e2bc | 2015-04-16 13:39:56 +0300 | [diff] [blame] | 25 | |
| 26 | #endif // COMPILER_TRANSLATOR_SEPARATEDECLARATIONS_H_ |