Commit Graph

21 Commits

Author SHA1 Message Date
Ian Romanick
03d3f3ab71 Remove ast_node::type
It isn't a type (is was enum specifying the kind of node), it was
unused, and it was easily confused with actual type fields.  Kill with fire.
2010-04-02 11:05:16 -07:00
Kenneth Graunke
ebfdef7a83 Set source locations on AST nodes so error messages print locations.
I haven't verified that these are all correct, but it's still a lot
better than not having anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-03-31 18:26:27 -07:00
Ian Romanick
92318a9479 Add ast_function::hir
ast_function::hir consists of bits pulled out of
ast_function_definition::hir.  In fact, the later uses the former to
do a lot of its processing.  Several class private data fields were
added to ast_function to facilitate communicate between the two.

This causes the following tests to pass:

    glslparsertest/shaders/CorrectModule.frag

This causes the following tests to fail.  These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.

    glslparsertest/shaders/function9.frag
    glslparsertest/shaders/function10.frag
2010-03-31 18:23:21 -07:00
Ian Romanick
d612a127cc Move type_specifier_to_glsl_type to ast_type_specifier::glsl_type
This make is easily accessible from other modules.
2010-03-31 16:22:06 -07:00
Ian Romanick
06e5308e29 Add parser support for texture rectangle types 2010-03-29 16:44:29 -07:00
Ian Romanick
3c6fea3048 Implement ir_if (for if-statments) and conversion from AST
The following tests now pass:

    glslparsertest/shaders/if1.frag
    glslparsertest/shaders/if2.frag

The following tests that used to pass now fail.  It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:17:11 -07:00
Kenneth Graunke
fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Ian Romanick
16a246c049 Initial bits for converting AST return nodes to IR return instructions 2010-03-19 16:51:16 -07:00
Ian Romanick
ed85a5dd4b Add new constructors for ast_type_specifier
Add a constructor that uses an ast_struct_specifier and one that uses
a type name.  This saves a (trivial) bit of code, but it also ensures
some of the class invariants (i.e., type_name != NULL) are met.
2010-03-15 14:28:17 -07:00
Ian Romanick
7f9d309743 Ensure that ast_type always has type_name set
For built-in types, type_name would be NULL.  This ensures that
type_name is set even for the built-in types.  This simplifies code in
a few places and centralizes the name setting code.
2010-03-15 14:18:32 -07:00
Ian Romanick
3821761e45 Differentiate in ast_function_expression between constructors and func. calls 2010-03-10 14:12:22 -08:00
Ian Romanick
986b8f7982 Tell emacs that C++ .h files are C++ 2010-03-10 13:58:12 -08:00
Ian Romanick
7cfddf1941 Make ast_function_expression subclass of ast_expression 2010-03-10 13:26:52 -08:00
Ian Romanick
d10fe19495 Simplified constructor for identifier expressions 2010-03-10 13:25:56 -08:00
Ian Romanick
d949a9afb0 Move top-level AST to HIR conversion to _mesa_ast_to_hir 2010-03-10 09:55:22 -08:00
Ian Romanick
0044e7edce Conver IR structures to use exec_list instead of simple_node 2010-03-08 23:44:54 -08:00
Ian Romanick
61484ba188 Remove prototypes for *_to_hir functions that no longer exist 2010-03-08 23:06:48 -08:00
Ian Romanick
18238de6c3 Make AST->HIR conversion a method of ast_node, re-enable 2010-03-01 13:49:10 -08:00
Ian Romanick
e41a1cd4d5 Replace tacky wrapper macros with tacky in-line type-casts 2010-02-25 12:49:55 -08:00
Ian Romanick
88349b22ca Add ast_expression_bin subclass of ast_expression
The ast_expression_bin subclass is used for all binary expressions
such as addition, subtraction, and comparisons.  Several other
subclasses are soon to follow.
2010-02-22 19:10:25 -08:00
Ian Romanick
a87ac255cf Initial commit. lol 2010-02-22 13:19:34 -08:00