Move top-level AST to HIR conversion to _mesa_ast_to_hir
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 10 Mar 2010 17:55:22 +0000 (09:55 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 10 Mar 2010 17:55:22 +0000 (09:55 -0800)
ast.h
ast_to_hir.cpp
glsl_parser_extras.cpp

diff --git a/ast.h b/ast.h
index fa84a915749c0dcf09b937c76f59696fffd7c6b4..363169209266fa63c7a122650be9b5d3e2c8b6bb 100644 (file)
--- 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,
index becc8327fb66aea65808afbba26398e85f45cf1c..e371007ef8bc38af4c9dd34fdbba0849f0d6b2ea 100644 (file)
 #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,
index 222f06b5263028898828a2725d251be15b890a08..d066ca3cd08875ba953bbd1cb78fdc07457a0502 100644 (file)
@@ -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) {