blob: d16357a3afd8e5b92c590b06e1ad68fe3aa72182 [file] [log] [blame]
Olli Etuaho822fa842015-04-16 14:26:10 +03001//
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 Etuahob1edc4f2015-11-02 17:20:03 +020012//
Olli Etuaho18b9deb2015-11-05 12:14:50 +020013// Note that if the array is declared as const, the initialization may still be split, making the
14// AST technically invalid. Because of that this transformation should only be used when subsequent
15// stages don't care about const qualifiers. However, the initialization will not be split if the
16// initializer can be written as a HLSL literal.
Olli Etuaho822fa842015-04-16 14:26:10 +030017
18#ifndef COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_
19#define COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_
20
21class TIntermNode;
22
23void SeparateArrayInitialization(TIntermNode *root);
24
25#endif // COMPILER_TRANSLATOR_SEPARATEARRAYINITIALIZATION_H_