diff options
-rw-r--r-- | ast.h | 3 | ||||
-rw-r--r-- | ast_to_hir.cpp | 11 | ||||
-rw-r--r-- | glsl_parser_extras.cpp | 4 |
3 files changed, 15 insertions, 3 deletions
@@ -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 becc8327fb..e371007ef8 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 222f06b526..d066ca3cd0 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) { |