Convert to new interfaces so that it will compile
[mesa.git] / hir_function.c
1 struct ir_instruction *
2 _mesa_ast_constructor_to_hir(const struct ast_node *n,
3 const struct ast_node *parameters,
4 struct _mesa_glsl_parse_state *state)
5 {
6 const struct ast_type_specifier *type = (struct ast_type_specifier *) n;
7
8
9 /* There are effectively three kinds of constructors. Each has its own set
10 * of rules.
11 *
12 * * Built-in scalar, vector, and matrix types: For each of these the only
13 * matching requirement is that the number of values supplied is
14 * sufficient to initialize all of the fields of the type.
15 * * Array types: The number of initializers must match the size of the
16 * array, if a size is specified. Each of the initializers must
17 * exactly match the base type of the array.
18 * * Structure types: These initializers must exactly match the fields of
19 * the structure in order. This is the most restrictive type.
20 *
21 * In all cases the built-in promotions from integer to floating-point types
22 * are applied.
23 */
24
25 if (type->is_array) {
26 /* FINISHME */
27 } else if ((type->type_specifier == ast_struct)
28 || (type->type_specifier == ast_type_name)) {
29 /* FINISHME */
30 } else {
31 const struct glsl_type *ctor_type;
32
33 /* Look-up the type, by name, in the symbol table.
34 */
35
36
37 /* Generate a series of assignments of constructor parameters to fields
38 * of the object being initialized.
39 */
40 }
41 }