summaryrefslogtreecommitdiff
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorTimothy Arceri <t_arceri@yahoo.com.au>2014-01-23 23:22:01 +1100
committerTimothy Arceri <t_arceri@yahoo.com.au>2014-01-23 23:37:37 +1100
commitb0c64d3cc6d1d3a64c86a5b2cd748b4178bff350 (patch)
tree71b1f532d7cbcca9f829cbc9891a08735800f9c6 /src/glsl/ast.h
parent61a584609936940f69207dd520b5b4208810a9e7 (diff)
glsl: remove remaining is_array variables
Previously the reason we needed is_array was because we used array_size == NULL to represent both non-arrays and unsized arrays. Now that we use a non-NULL array_specifier to represent an unsized array, is_array is redundant. Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index d462dd59763..0bda28d20dd 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -371,14 +371,13 @@ public:
class ast_declaration : public ast_node {
public:
- ast_declaration(const char *identifier, bool is_array,
+ ast_declaration(const char *identifier,
ast_array_specifier *array_specifier,
ast_expression *initializer);
virtual void print(void) const;
const char *identifier;
-
- bool is_array;
+
ast_array_specifier *array_specifier;
ast_expression *initializer;
@@ -588,10 +587,10 @@ public:
* Use only if the objects are allocated from the same context and will not
* be modified. Zeros the inherited ast_node's fields.
*/
- ast_type_specifier(const ast_type_specifier *that, bool is_array,
+ ast_type_specifier(const ast_type_specifier *that,
ast_array_specifier *array_specifier)
: ast_node(), type_name(that->type_name), structure(that->structure),
- is_array(is_array), array_specifier(array_specifier),
+ array_specifier(array_specifier),
default_precision(that->default_precision)
{
/* empty */
@@ -599,8 +598,7 @@ public:
/** Construct a type specifier from a type name */
ast_type_specifier(const char *name)
- : type_name(name), structure(NULL),
- is_array(false), array_specifier(NULL),
+ : type_name(name), structure(NULL), array_specifier(NULL),
default_precision(ast_precision_none)
{
/* empty */
@@ -608,8 +606,7 @@ public:
/** Construct a type specifier from a structure definition */
ast_type_specifier(ast_struct_specifier *s)
- : type_name(s->name), structure(s),
- is_array(false), array_specifier(NULL),
+ : type_name(s->name), structure(s), array_specifier(NULL),
default_precision(ast_precision_none)
{
/* empty */
@@ -626,7 +623,6 @@ public:
const char *type_name;
ast_struct_specifier *structure;
- bool is_array;
ast_array_specifier *array_specifier;
/** For precision statements, this is the given precision; otherwise none. */
@@ -680,7 +676,6 @@ public:
ast_parameter_declarator() :
type(NULL),
identifier(NULL),
- is_array(false),
array_specifier(NULL),
formal_parameter(false),
is_void(false)
@@ -695,7 +690,6 @@ public:
ast_fully_specified_type *type;
const char *identifier;
- bool is_array;
ast_array_specifier *array_specifier;
static void parameters_to_hir(exec_list *ast_parameters,
@@ -943,13 +937,10 @@ class ast_interface_block : public ast_node {
public:
ast_interface_block(ast_type_qualifier layout,
const char *instance_name,
- bool is_array,
ast_array_specifier *array_specifier)
: layout(layout), block_name(NULL), instance_name(instance_name),
- is_array(is_array), array_specifier(array_specifier)
+ array_specifier(array_specifier)
{
- if (!is_array)
- assert(array_specifier == NULL);
}
virtual ir_rvalue *hir(exec_list *instructions,
@@ -970,15 +961,6 @@ public:
exec_list declarations;
/**
- * True if the block is declared as an array
- *
- * \note
- * A block can only be an array if it also has an instance name. If this
- * field is true, ::instance_name must also not be \c NULL.
- */
- bool is_array;
-
- /**
* Declared array size of the block instance
*
* If the block is not declared as an array or if the block instance array