From: Ian Romanick Date: Wed, 10 Mar 2010 17:55:22 +0000 (-0800) Subject: Move top-level AST to HIR conversion to _mesa_ast_to_hir X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d949a9afb0a01e9678a4343f66b056b41a2e48a9;p=mesa.git Move top-level AST to HIR conversion to _mesa_ast_to_hir --- diff --git a/ast.h b/ast.h index fa84a915749..36316920926 100644 --- a/ast.h +++ b/ast.h @@ -492,6 +492,9 @@ public: }; +extern void +_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state); + extern struct ir_instruction * _mesa_ast_field_selection_to_hir(const struct ast_expression *expr, exec_list *instructions, diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index becc8327fb6..e371007ef8b 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -56,6 +56,17 @@ #include "glsl_types.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 * arithmetic_result_type(const struct glsl_type *type_a, const struct glsl_type *type_b, diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp index 222f06b5263..d066ca3cd08 100644 --- a/glsl_parser_extras.cpp +++ b/glsl_parser_extras.cpp @@ -718,9 +718,7 @@ main(int argc, char **argv) ((ast_node *)ptr)->print(); } - foreach (ptr, & state.translation_unit) { - ((ast_node *)ptr)->hir(&instructions, &state); - } + _mesa_ast_to_hir(&instructions, &state); printf("\n\n"); foreach_iter(exec_list_iterator, iter, instructions) {