Ian Romanick
e309a6051d
Add multiple include protection to ir.h
2010-03-15 15:20:15 -07:00
Ian Romanick
5c2bd09888
Trivial clean-ups to ast_type_specifier(int) constructor
2010-03-15 14:31:48 -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
bbddcb3092
Factor ast_type_specifier code out to ast_type.cpp
2010-03-15 14:09:23 -07:00
Ian Romanick
f4749610ed
Factor guts of function matching code out to match_function_by_name
...
This function will be used for matching some types of constructors as well.
2010-03-15 13:26:02 -07:00
Ian Romanick
548fa293a3
Move ast_function_expression::hir to ast_function.cpp
2010-03-15 13:04:13 -07:00
Ian Romanick
728330e3b2
Remove DOA hir_function.c file
2010-03-15 13:02:08 -07:00
Ian Romanick
f13d4295f9
Change type of function_identifier to silence bison warning
...
When the implementation of function_call_header and
function_identifier were changed a few commits ago, the types of the
production changed. This just updates the types specified for the
productions to match reality.
2010-03-11 16:12:25 -08:00
Ian Romanick
44eb13d0b5
Add parameters to function declarations in the correct order
2010-03-11 16:11:07 -08:00
Ian Romanick
471471f834
Initial pass at resolving function calls
...
The code is still really rough and *REALLY* incomplete. This at least
passes the first few trivially simple test cases.
2010-03-11 14:57:26 -08:00
Ian Romanick
cdb8d54b68
Default function parameters to 'in' instead of auto
2010-03-11 14:48:51 -08:00
Ian Romanick
7e3ed40200
Add a handful of simple tests for function calls in constructors
2010-03-11 14:46:19 -08:00
Ian Romanick
ed45ec6a51
Add ir_call call to represent function calls.
2010-03-11 14:35:37 -08:00
Ian Romanick
d27ec2461b
Fix broken constructor of ir_instruction base class
...
Make the constructor inline-able, and don't try to initialize it as a
simple_node. It hasn't been derived from simple_node in a long time.
2010-03-11 14:23:41 -08:00
Ian Romanick
1f58518059
Track generation of errors and halt compilation appropriately
2010-03-11 14:08:33 -08: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
adfb0cd740
IR variable: Initial work to support GLSL built-in variables
2010-03-10 10:43:54 -08:00
Ian Romanick
f52888fac0
Include cstdlib to be sure size_t is available
2010-03-10 10:42:37 -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
8e6cd3bf54
Require the shader target be specified to the driver program
2010-03-10 09:31:30 -08:00
Ian Romanick
1c4156ffac
Use ir_print_visitor to dump IR tree
2010-03-10 09:27:03 -08:00
Ian Romanick
02ae68f496
Fix typeo in gl_FogParameters.scale (was scalre)
2010-03-10 00:52:39 -08:00
Ian Romanick
0b67823462
AST to IR: Mark 'varying' in a vertex shader as 'out'
2010-03-10 00:28:59 -08:00
Ian Romanick
654c057257
ir_variable: Initialize all attribute bits to reasonable defaults
...
This prevents variables from randomly having their 'invariant' or
'read_only' bits set, for example.
2010-03-10 00:21:27 -08:00
Ian Romanick
fe10250355
IR print visitor: Add some support for printing types and constants
2010-03-09 21:44:34 -08:00
Ian Romanick
6044ae79a0
IR print visitor: Print assignments
2010-03-09 16:40:45 -08:00
Ian Romanick
6652af36fe
Add assignment side-effect to the instruction stream
...
The actual assignment is a side-effect of the assignment expression.
Add it to the instruction stream and return the LHS of the assignment
as its rvalue.
2010-03-09 16:38:02 -08:00
Ian Romanick
78b51b0fdd
IR visitor: Add initial version of ir_visitor classes
...
The ir_visitor class is the abstract base class for all visitors.
ir_print_visitor contains the beginnings of a concrete visitor class
that will print out an IR sequence in a Lisp / Scheme-like syntax.
2010-03-09 16:26:15 -08:00
Ian Romanick
fce1150156
Convert is_glsl_type_matrix to glsl_type::is_matrix
2010-03-09 15:58:52 -08:00
Ian Romanick
a2dd22fb19
Convert is_glsl_type_vector to glsl_type::is_vector
2010-03-09 15:55:16 -08:00
Ian Romanick
cb36f8aaee
Convert is_glsl_type_scalar to glsl_type::is_scalar
2010-03-09 15:51:22 -08:00
Ian Romanick
eccf0bf5f2
Make glsl_type a class
...
Among other benefits, this cleans up a the hackery invovled in
initializing the union field in builtin_types.h.
2010-03-09 15:49:31 -08:00
Ian Romanick
3a9e989628
Remove unused function
2010-03-08 23:44:59 -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
7e4ce71923
Add yet-another linked list type
...
The use of macros to access existing linked list type makes it
unsuitable for its current use as a base class. Since this type and
the accompanying macros are used all over the place in Mesa, we can't
really change them.
2010-03-08 23:42:45 -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
1e2e58c1f6
Set C++ indent too.
2010-03-08 13:02:58 -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
d59673c9de
autoconf for the ...
2010-02-25 17:17:23 -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
168890ce1b
Convert to new interfaces so that it will compile
...
Convert TRUE and FALSE to true and false. Convert
_mesa_ast_get_location to ast_node::get_location.
2010-02-25 12:24:40 -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
89227f6ce4
Ignore all build products
2010-02-22 19:09:45 -08:00
Ian Romanick
d5f4f09e76
Rename .cc files to .cpp
2010-02-22 18:43:08 -08:00
Ian Romanick
53d2774ee3
Initialize the node structure embedded in the ast_node
2010-02-22 13:22:10 -08:00
Ian Romanick
a87ac255cf
Initial commit. lol
2010-02-22 13:19:34 -08:00