Move top-level AST to HIR conversion to _mesa_ast_to_hir

This commit is contained in:
Ian Romanick
2010-03-10 09:55:22 -08:00
parent 8e6cd3bf54
commit d949a9afb0
3 changed files with 15 additions and 3 deletions

3
ast.h
View File

@@ -492,6 +492,9 @@ public:
}; };
extern void
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state);
extern struct ir_instruction * extern struct ir_instruction *
_mesa_ast_field_selection_to_hir(const struct ast_expression *expr, _mesa_ast_field_selection_to_hir(const struct ast_expression *expr,
exec_list *instructions, exec_list *instructions,

View File

@@ -56,6 +56,17 @@
#include "glsl_types.h" #include "glsl_types.h"
#include "ir.h" #include "ir.h"
void
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
{
struct simple_node *ptr;
foreach (ptr, & state->translation_unit) {
((ast_node *)ptr)->hir(instructions, state);
}
}
static const struct glsl_type * static const struct glsl_type *
arithmetic_result_type(const struct glsl_type *type_a, arithmetic_result_type(const struct glsl_type *type_a,
const struct glsl_type *type_b, const struct glsl_type *type_b,

View File

@@ -718,9 +718,7 @@ main(int argc, char **argv)
((ast_node *)ptr)->print(); ((ast_node *)ptr)->print();
} }
foreach (ptr, & state.translation_unit) { _mesa_ast_to_hir(&instructions, &state);
((ast_node *)ptr)->hir(&instructions, &state);
}
printf("\n\n"); printf("\n\n");
foreach_iter(exec_list_iterator, iter, instructions) { foreach_iter(exec_list_iterator, iter, instructions) {