glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.
_mesa_glsl_parse_state should be the parent for all temporary allocation done while compiling a shader. glsl_shader should only be used as the parent for the shader's final IR---the _result_ of compilation. Since many IR instructions may be added or discarded during optimization passes, IR should not ever be allocated to glsl_shader directly. Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g. This also removes a ton of talloc_parent calls, which may help performance.
This commit is contained in:

committed by
Ian Romanick

parent
116f1d4f95
commit
953ff1283d
@@ -59,7 +59,7 @@ process_call(exec_list *instructions, ir_function *f,
|
|||||||
YYLTYPE *loc, exec_list *actual_parameters,
|
YYLTYPE *loc, exec_list *actual_parameters,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
|
|
||||||
const ir_function_signature *sig =
|
const ir_function_signature *sig =
|
||||||
f->matching_signature(actual_parameters);
|
f->matching_signature(actual_parameters);
|
||||||
@@ -119,7 +119,7 @@ match_function_by_name(exec_list *instructions, const char *name,
|
|||||||
YYLTYPE *loc, exec_list *actual_parameters,
|
YYLTYPE *loc, exec_list *actual_parameters,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ir_function *f = state->symbols->get_function(name);
|
ir_function *f = state->symbols->get_function(name);
|
||||||
|
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
@@ -244,7 +244,7 @@ process_array_constructor(exec_list *instructions,
|
|||||||
YYLTYPE *loc, exec_list *parameters,
|
YYLTYPE *loc, exec_list *parameters,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
/* Array constructors come in two forms: sized and unsized. Sized array
|
/* Array constructors come in two forms: sized and unsized. Sized array
|
||||||
* constructors look like 'vec4[2](a, b)', where 'a' and 'b' are vec4
|
* constructors look like 'vec4[2](a, b)', where 'a' and 'b' are vec4
|
||||||
* variables. In this case the number of parameters must exactly match the
|
* variables. In this case the number of parameters must exactly match the
|
||||||
@@ -318,7 +318,7 @@ constant_record_constructor(const glsl_type *constructor_type,
|
|||||||
YYLTYPE *loc, exec_list *parameters,
|
YYLTYPE *loc, exec_list *parameters,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
bool all_parameters_are_constant = true;
|
bool all_parameters_are_constant = true;
|
||||||
|
|
||||||
exec_node *node = parameters->head;
|
exec_node *node = parameters->head;
|
||||||
@@ -862,7 +862,7 @@ ir_rvalue *
|
|||||||
ast_function_expression::hir(exec_list *instructions,
|
ast_function_expression::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
/* There are three sorts of function calls.
|
/* There are three sorts of function calls.
|
||||||
*
|
*
|
||||||
* 1. contstructors - The first subexpression is an ast_type_specifier.
|
* 1. contstructors - The first subexpression is an ast_type_specifier.
|
||||||
|
@@ -86,7 +86,7 @@ static bool
|
|||||||
apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
|
apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
if (to->base_type == from->type->base_type)
|
if (to->base_type == from->type->base_type)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -473,7 +473,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
|
|||||||
ir_rvalue *lhs, ir_rvalue *rhs,
|
ir_rvalue *lhs, ir_rvalue *rhs,
|
||||||
YYLTYPE lhs_loc)
|
YYLTYPE lhs_loc)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
|
bool error_emitted = (lhs->type->is_error() || rhs->type->is_error());
|
||||||
|
|
||||||
if (!error_emitted) {
|
if (!error_emitted) {
|
||||||
@@ -550,7 +550,7 @@ static ir_variable *
|
|||||||
generate_temporary(const glsl_type *type, exec_list *instructions,
|
generate_temporary(const glsl_type *type, exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
char *name = (char *) malloc(sizeof(char) * 13);
|
char *name = (char *) malloc(sizeof(char) * 13);
|
||||||
|
|
||||||
snprintf(name, 13, "tmp_%08X", state->temp_index);
|
snprintf(name, 13, "tmp_%08X", state->temp_index);
|
||||||
@@ -600,7 +600,7 @@ ir_rvalue *
|
|||||||
ast_expression::hir(exec_list *instructions,
|
ast_expression::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
static const int operations[AST_NUM_OPERATORS] = {
|
static const int operations[AST_NUM_OPERATORS] = {
|
||||||
-1, /* ast_assign doesn't convert to ir_expression. */
|
-1, /* ast_assign doesn't convert to ir_expression. */
|
||||||
-1, /* ast_plus doesn't convert to ir_expression. */
|
-1, /* ast_plus doesn't convert to ir_expression. */
|
||||||
@@ -1544,7 +1544,7 @@ ir_rvalue *
|
|||||||
ast_declarator_list::hir(exec_list *instructions,
|
ast_declarator_list::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
const struct glsl_type *decl_type;
|
const struct glsl_type *decl_type;
|
||||||
const char *type_name = NULL;
|
const char *type_name = NULL;
|
||||||
ir_rvalue *result = NULL;
|
ir_rvalue *result = NULL;
|
||||||
@@ -1883,7 +1883,7 @@ ir_rvalue *
|
|||||||
ast_parameter_declarator::hir(exec_list *instructions,
|
ast_parameter_declarator::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
const struct glsl_type *type;
|
const struct glsl_type *type;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
YYLTYPE loc = this->get_location();
|
YYLTYPE loc = this->get_location();
|
||||||
@@ -1984,7 +1984,7 @@ ir_rvalue *
|
|||||||
ast_function::hir(exec_list *instructions,
|
ast_function::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ir_function *f = NULL;
|
ir_function *f = NULL;
|
||||||
ir_function_signature *sig = NULL;
|
ir_function_signature *sig = NULL;
|
||||||
exec_list hir_parameters;
|
exec_list hir_parameters;
|
||||||
@@ -2152,7 +2152,7 @@ ir_rvalue *
|
|||||||
ast_jump_statement::hir(exec_list *instructions,
|
ast_jump_statement::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ast_return: {
|
case ast_return: {
|
||||||
@@ -2255,7 +2255,7 @@ ir_rvalue *
|
|||||||
ast_selection_statement::hir(exec_list *instructions,
|
ast_selection_statement::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
|
|
||||||
ir_rvalue *const condition = this->condition->hir(instructions, state);
|
ir_rvalue *const condition = this->condition->hir(instructions, state);
|
||||||
|
|
||||||
@@ -2295,7 +2295,7 @@ void
|
|||||||
ast_iteration_statement::condition_to_hir(ir_loop *stmt,
|
ast_iteration_statement::condition_to_hir(ir_loop *stmt,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
|
|
||||||
if (condition != NULL) {
|
if (condition != NULL) {
|
||||||
ir_rvalue *const cond =
|
ir_rvalue *const cond =
|
||||||
@@ -2331,7 +2331,7 @@ ir_rvalue *
|
|||||||
ast_iteration_statement::hir(exec_list *instructions,
|
ast_iteration_statement::hir(exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
|
|
||||||
/* For-loops and while-loops start a new scope, but do-while loops do not.
|
/* For-loops and while-loops start a new scope, but do-while loops do not.
|
||||||
*/
|
*/
|
||||||
|
@@ -313,7 +313,7 @@ precision return PRECISION;
|
|||||||
|
|
||||||
[_a-zA-Z][_a-zA-Z0-9]* {
|
[_a-zA-Z][_a-zA-Z0-9]* {
|
||||||
struct _mesa_glsl_parse_state *state = yyextra;
|
struct _mesa_glsl_parse_state *state = yyextra;
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
yylval->identifier = talloc_strdup(ctx, yytext);
|
yylval->identifier = talloc_strdup(ctx, yytext);
|
||||||
return IDENTIFIER;
|
return IDENTIFIER;
|
||||||
}
|
}
|
||||||
|
@@ -255,35 +255,35 @@ variable_identifier:
|
|||||||
primary_expression:
|
primary_expression:
|
||||||
variable_identifier
|
variable_identifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.identifier = $1;
|
$$->primary_expression.identifier = $1;
|
||||||
}
|
}
|
||||||
| INTCONSTANT
|
| INTCONSTANT
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.int_constant = $1;
|
$$->primary_expression.int_constant = $1;
|
||||||
}
|
}
|
||||||
| UINTCONSTANT
|
| UINTCONSTANT
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.uint_constant = $1;
|
$$->primary_expression.uint_constant = $1;
|
||||||
}
|
}
|
||||||
| FLOATCONSTANT
|
| FLOATCONSTANT
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.float_constant = $1;
|
$$->primary_expression.float_constant = $1;
|
||||||
}
|
}
|
||||||
| BOOLCONSTANT
|
| BOOLCONSTANT
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.bool_constant = $1;
|
$$->primary_expression.bool_constant = $1;
|
||||||
@@ -298,7 +298,7 @@ postfix_expression:
|
|||||||
primary_expression
|
primary_expression
|
||||||
| postfix_expression '[' integer_expression ']'
|
| postfix_expression '[' integer_expression ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_array_index, $1, $3, NULL);
|
$$ = new(ctx) ast_expression(ast_array_index, $1, $3, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -314,20 +314,20 @@ postfix_expression:
|
|||||||
}
|
}
|
||||||
| postfix_expression '.' IDENTIFIER
|
| postfix_expression '.' IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->primary_expression.identifier = $3;
|
$$->primary_expression.identifier = $3;
|
||||||
}
|
}
|
||||||
| postfix_expression INC_OP
|
| postfix_expression INC_OP
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_post_inc, $1, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_post_inc, $1, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| postfix_expression DEC_OP
|
| postfix_expression DEC_OP
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_post_dec, $1, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_post_dec, $1, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -345,7 +345,7 @@ function_call_or_method:
|
|||||||
function_call_generic
|
function_call_generic
|
||||||
| postfix_expression '.' function_call_generic
|
| postfix_expression '.' function_call_generic
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL);
|
$$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -386,20 +386,20 @@ function_call_header:
|
|||||||
function_identifier:
|
function_identifier:
|
||||||
type_specifier
|
type_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_function_expression($1);
|
$$ = new(ctx) ast_function_expression($1);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| IDENTIFIER
|
| IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_expression *callee = new(ctx) ast_expression($1);
|
ast_expression *callee = new(ctx) ast_expression($1);
|
||||||
$$ = new(ctx) ast_function_expression(callee);
|
$$ = new(ctx) ast_function_expression(callee);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| FIELD_SELECTION
|
| FIELD_SELECTION
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_expression *callee = new(ctx) ast_expression($1);
|
ast_expression *callee = new(ctx) ast_expression($1);
|
||||||
$$ = new(ctx) ast_function_expression(callee);
|
$$ = new(ctx) ast_function_expression(callee);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
@@ -411,19 +411,19 @@ unary_expression:
|
|||||||
postfix_expression
|
postfix_expression
|
||||||
| INC_OP unary_expression
|
| INC_OP unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_pre_inc, $2, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_pre_inc, $2, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| DEC_OP unary_expression
|
| DEC_OP unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_pre_dec, $2, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_pre_dec, $2, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| unary_operator unary_expression
|
| unary_operator unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression($1, $2, NULL, NULL);
|
$$ = new(ctx) ast_expression($1, $2, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -441,19 +441,19 @@ multiplicative_expression:
|
|||||||
unary_expression
|
unary_expression
|
||||||
| multiplicative_expression '*' unary_expression
|
| multiplicative_expression '*' unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_mul, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_mul, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| multiplicative_expression '/' unary_expression
|
| multiplicative_expression '/' unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_div, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_div, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| multiplicative_expression '%' unary_expression
|
| multiplicative_expression '%' unary_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_mod, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_mod, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -463,13 +463,13 @@ additive_expression:
|
|||||||
multiplicative_expression
|
multiplicative_expression
|
||||||
| additive_expression '+' multiplicative_expression
|
| additive_expression '+' multiplicative_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_add, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_add, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| additive_expression '-' multiplicative_expression
|
| additive_expression '-' multiplicative_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_sub, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_sub, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -479,13 +479,13 @@ shift_expression:
|
|||||||
additive_expression
|
additive_expression
|
||||||
| shift_expression LEFT_OP additive_expression
|
| shift_expression LEFT_OP additive_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_lshift, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_lshift, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| shift_expression RIGHT_OP additive_expression
|
| shift_expression RIGHT_OP additive_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_rshift, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_rshift, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -495,25 +495,25 @@ relational_expression:
|
|||||||
shift_expression
|
shift_expression
|
||||||
| relational_expression '<' shift_expression
|
| relational_expression '<' shift_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_less, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_less, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| relational_expression '>' shift_expression
|
| relational_expression '>' shift_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_greater, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_greater, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| relational_expression LE_OP shift_expression
|
| relational_expression LE_OP shift_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_lequal, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_lequal, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| relational_expression GE_OP shift_expression
|
| relational_expression GE_OP shift_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_gequal, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_gequal, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -523,13 +523,13 @@ equality_expression:
|
|||||||
relational_expression
|
relational_expression
|
||||||
| equality_expression EQ_OP relational_expression
|
| equality_expression EQ_OP relational_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_equal, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_equal, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| equality_expression NE_OP relational_expression
|
| equality_expression NE_OP relational_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_nequal, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_nequal, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@ and_expression:
|
|||||||
equality_expression
|
equality_expression
|
||||||
| and_expression '&' equality_expression
|
| and_expression '&' equality_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ exclusive_or_expression:
|
|||||||
and_expression
|
and_expression
|
||||||
| exclusive_or_expression '^' and_expression
|
| exclusive_or_expression '^' and_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_bit_xor, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_bit_xor, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -559,7 +559,7 @@ inclusive_or_expression:
|
|||||||
exclusive_or_expression
|
exclusive_or_expression
|
||||||
| inclusive_or_expression '|' exclusive_or_expression
|
| inclusive_or_expression '|' exclusive_or_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -569,7 +569,7 @@ logical_and_expression:
|
|||||||
inclusive_or_expression
|
inclusive_or_expression
|
||||||
| logical_and_expression AND_OP inclusive_or_expression
|
| logical_and_expression AND_OP inclusive_or_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_logic_and, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_logic_and, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -579,7 +579,7 @@ logical_xor_expression:
|
|||||||
logical_and_expression
|
logical_and_expression
|
||||||
| logical_xor_expression XOR_OP logical_and_expression
|
| logical_xor_expression XOR_OP logical_and_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_logic_xor, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_logic_xor, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -589,7 +589,7 @@ logical_or_expression:
|
|||||||
logical_xor_expression
|
logical_xor_expression
|
||||||
| logical_or_expression OR_OP logical_xor_expression
|
| logical_or_expression OR_OP logical_xor_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_bin(ast_logic_or, $1, $3);
|
$$ = new(ctx) ast_expression_bin(ast_logic_or, $1, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -599,7 +599,7 @@ conditional_expression:
|
|||||||
logical_or_expression
|
logical_or_expression
|
||||||
| logical_or_expression '?' expression ':' assignment_expression
|
| logical_or_expression '?' expression ':' assignment_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression(ast_conditional, $1, $3, $5);
|
$$ = new(ctx) ast_expression(ast_conditional, $1, $3, $5);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -609,7 +609,7 @@ assignment_expression:
|
|||||||
conditional_expression
|
conditional_expression
|
||||||
| unary_expression assignment_operator assignment_expression
|
| unary_expression assignment_operator assignment_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression($2, $1, $3, NULL);
|
$$ = new(ctx) ast_expression($2, $1, $3, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -636,7 +636,7 @@ expression:
|
|||||||
}
|
}
|
||||||
| expression ',' assignment_expression
|
| expression ',' assignment_expression
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
if ($1->oper != ast_sequence) {
|
if ($1->oper != ast_sequence) {
|
||||||
$$ = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL);
|
$$ = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
@@ -700,7 +700,7 @@ function_header_with_parameters:
|
|||||||
function_header:
|
function_header:
|
||||||
fully_specified_type IDENTIFIER '('
|
fully_specified_type IDENTIFIER '('
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_function();
|
$$ = new(ctx) ast_function();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->return_type = $1;
|
$$->return_type = $1;
|
||||||
@@ -711,7 +711,7 @@ function_header:
|
|||||||
parameter_declarator:
|
parameter_declarator:
|
||||||
type_specifier IDENTIFIER
|
type_specifier IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_parameter_declarator();
|
$$ = new(ctx) ast_parameter_declarator();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->type = new(ctx) ast_fully_specified_type();
|
$$->type = new(ctx) ast_fully_specified_type();
|
||||||
@@ -721,7 +721,7 @@ parameter_declarator:
|
|||||||
}
|
}
|
||||||
| type_specifier IDENTIFIER '[' constant_expression ']'
|
| type_specifier IDENTIFIER '[' constant_expression ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_parameter_declarator();
|
$$ = new(ctx) ast_parameter_declarator();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->type = new(ctx) ast_fully_specified_type();
|
$$->type = new(ctx) ast_fully_specified_type();
|
||||||
@@ -748,7 +748,7 @@ parameter_declaration:
|
|||||||
}
|
}
|
||||||
| parameter_type_qualifier parameter_qualifier parameter_type_specifier
|
| parameter_type_qualifier parameter_qualifier parameter_type_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$1.i |= $2.i;
|
$1.i |= $2.i;
|
||||||
|
|
||||||
$$ = new(ctx) ast_parameter_declarator();
|
$$ = new(ctx) ast_parameter_declarator();
|
||||||
@@ -759,7 +759,7 @@ parameter_declaration:
|
|||||||
}
|
}
|
||||||
| parameter_qualifier parameter_type_specifier
|
| parameter_qualifier parameter_type_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_parameter_declarator();
|
$$ = new(ctx) ast_parameter_declarator();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->type = new(ctx) ast_fully_specified_type();
|
$$->type = new(ctx) ast_fully_specified_type();
|
||||||
@@ -783,7 +783,7 @@ init_declarator_list:
|
|||||||
single_declaration
|
single_declaration
|
||||||
| init_declarator_list ',' IDENTIFIER
|
| init_declarator_list ',' IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, NULL);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -792,7 +792,7 @@ init_declarator_list:
|
|||||||
}
|
}
|
||||||
| init_declarator_list ',' IDENTIFIER '[' ']'
|
| init_declarator_list ',' IDENTIFIER '[' ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, NULL);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -801,7 +801,7 @@ init_declarator_list:
|
|||||||
}
|
}
|
||||||
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']'
|
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, NULL);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -810,7 +810,7 @@ init_declarator_list:
|
|||||||
}
|
}
|
||||||
| init_declarator_list ',' IDENTIFIER '[' ']' '=' initializer
|
| init_declarator_list ',' IDENTIFIER '[' ']' '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, $7);
|
ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, $7);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -819,7 +819,7 @@ init_declarator_list:
|
|||||||
}
|
}
|
||||||
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']' '=' initializer
|
| init_declarator_list ',' IDENTIFIER '[' constant_expression ']' '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, $8);
|
ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, $8);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -828,7 +828,7 @@ init_declarator_list:
|
|||||||
}
|
}
|
||||||
| init_declarator_list ',' IDENTIFIER '=' initializer
|
| init_declarator_list ',' IDENTIFIER '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, $5);
|
ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, $5);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
|
|
||||||
@@ -841,7 +841,7 @@ init_declarator_list:
|
|||||||
single_declaration:
|
single_declaration:
|
||||||
fully_specified_type
|
fully_specified_type
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
if ($1->specifier->type_specifier != ast_struct) {
|
if ($1->specifier->type_specifier != ast_struct) {
|
||||||
_mesa_glsl_error(& @1, state, "empty declaration list\n");
|
_mesa_glsl_error(& @1, state, "empty declaration list\n");
|
||||||
YYERROR;
|
YYERROR;
|
||||||
@@ -852,7 +852,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER
|
| fully_specified_type IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -861,7 +861,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '[' ']'
|
| fully_specified_type IDENTIFIER '[' ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, NULL);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -870,7 +870,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '[' constant_expression ']'
|
| fully_specified_type IDENTIFIER '[' constant_expression ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, NULL);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -879,7 +879,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '[' ']' '=' initializer
|
| fully_specified_type IDENTIFIER '[' ']' '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, $6);
|
ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, $6);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -888,7 +888,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '[' constant_expression ']' '=' initializer
|
| fully_specified_type IDENTIFIER '[' constant_expression ']' '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, $7);
|
ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, $7);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -897,7 +897,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '=' initializer
|
| fully_specified_type IDENTIFIER '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
|
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list($1);
|
$$ = new(ctx) ast_declarator_list($1);
|
||||||
@@ -906,7 +906,7 @@ single_declaration:
|
|||||||
}
|
}
|
||||||
| INVARIANT IDENTIFIER // Vertex only.
|
| INVARIANT IDENTIFIER // Vertex only.
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
|
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL);
|
||||||
|
|
||||||
$$ = new(ctx) ast_declarator_list(NULL);
|
$$ = new(ctx) ast_declarator_list(NULL);
|
||||||
@@ -920,14 +920,14 @@ single_declaration:
|
|||||||
fully_specified_type:
|
fully_specified_type:
|
||||||
type_specifier
|
type_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_fully_specified_type();
|
$$ = new(ctx) ast_fully_specified_type();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->specifier = $1;
|
$$->specifier = $1;
|
||||||
}
|
}
|
||||||
| type_qualifier type_specifier
|
| type_qualifier type_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_fully_specified_type();
|
$$ = new(ctx) ast_fully_specified_type();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->qualifier = $1.q;
|
$$->qualifier = $1.q;
|
||||||
@@ -998,19 +998,19 @@ type_specifier_no_prec:
|
|||||||
type_specifier_nonarray:
|
type_specifier_nonarray:
|
||||||
basic_type_specifier_nonarray
|
basic_type_specifier_nonarray
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_type_specifier($1);
|
$$ = new(ctx) ast_type_specifier($1);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| struct_specifier
|
| struct_specifier
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_type_specifier($1);
|
$$ = new(ctx) ast_type_specifier($1);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| IDENTIFIER
|
| IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_type_specifier($1);
|
$$ = new(ctx) ast_type_specifier($1);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1112,13 +1112,13 @@ precision_qualifier:
|
|||||||
struct_specifier:
|
struct_specifier:
|
||||||
STRUCT IDENTIFIER '{' struct_declaration_list '}'
|
STRUCT IDENTIFIER '{' struct_declaration_list '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_struct_specifier($2, $4);
|
$$ = new(ctx) ast_struct_specifier($2, $4);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| STRUCT '{' struct_declaration_list '}'
|
| STRUCT '{' struct_declaration_list '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_struct_specifier(NULL, $3);
|
$$ = new(ctx) ast_struct_specifier(NULL, $3);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1140,7 +1140,7 @@ struct_declaration_list:
|
|||||||
struct_declaration:
|
struct_declaration:
|
||||||
type_specifier struct_declarator_list ';'
|
type_specifier struct_declarator_list ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_fully_specified_type *type = new(ctx) ast_fully_specified_type();
|
ast_fully_specified_type *type = new(ctx) ast_fully_specified_type();
|
||||||
type->set_location(yylloc);
|
type->set_location(yylloc);
|
||||||
|
|
||||||
@@ -1168,13 +1168,13 @@ struct_declarator_list:
|
|||||||
struct_declarator:
|
struct_declarator:
|
||||||
IDENTIFIER
|
IDENTIFIER
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_declaration($1, false, NULL, NULL);
|
$$ = new(ctx) ast_declaration($1, false, NULL, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| IDENTIFIER '[' constant_expression ']'
|
| IDENTIFIER '[' constant_expression ']'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_declaration($1, true, $3, NULL);
|
$$ = new(ctx) ast_declaration($1, true, $3, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1217,13 +1217,13 @@ simple_statement:
|
|||||||
compound_statement:
|
compound_statement:
|
||||||
'{' '}'
|
'{' '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_compound_statement(true, NULL);
|
$$ = new(ctx) ast_compound_statement(true, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| '{' statement_list '}'
|
| '{' statement_list '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_compound_statement(true, $2);
|
$$ = new(ctx) ast_compound_statement(true, $2);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1237,13 +1237,13 @@ statement_no_new_scope:
|
|||||||
compound_statement_no_new_scope:
|
compound_statement_no_new_scope:
|
||||||
'{' '}'
|
'{' '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_compound_statement(false, NULL);
|
$$ = new(ctx) ast_compound_statement(false, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| '{' statement_list '}'
|
| '{' statement_list '}'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_compound_statement(false, $2);
|
$$ = new(ctx) ast_compound_statement(false, $2);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1274,13 +1274,13 @@ statement_list:
|
|||||||
expression_statement:
|
expression_statement:
|
||||||
';'
|
';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_statement(NULL);
|
$$ = new(ctx) ast_expression_statement(NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| expression ';'
|
| expression ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_expression_statement($1);
|
$$ = new(ctx) ast_expression_statement($1);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1289,7 +1289,7 @@ expression_statement:
|
|||||||
selection_statement_matched:
|
selection_statement_matched:
|
||||||
IF '(' expression ')' statement_matched ELSE statement_matched
|
IF '(' expression ')' statement_matched ELSE statement_matched
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_selection_statement($3, $5, $7);
|
$$ = new(ctx) ast_selection_statement($3, $5, $7);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1298,19 +1298,19 @@ selection_statement_matched:
|
|||||||
selection_statement_unmatched:
|
selection_statement_unmatched:
|
||||||
IF '(' expression ')' statement_matched
|
IF '(' expression ')' statement_matched
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_selection_statement($3, $5, NULL);
|
$$ = new(ctx) ast_selection_statement($3, $5, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| IF '(' expression ')' statement_unmatched
|
| IF '(' expression ')' statement_unmatched
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_selection_statement($3, $5, NULL);
|
$$ = new(ctx) ast_selection_statement($3, $5, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| IF '(' expression ')' statement_matched ELSE statement_unmatched
|
| IF '(' expression ')' statement_matched ELSE statement_unmatched
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_selection_statement($3, $5, $7);
|
$$ = new(ctx) ast_selection_statement($3, $5, $7);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1323,7 +1323,7 @@ condition:
|
|||||||
}
|
}
|
||||||
| fully_specified_type IDENTIFIER '=' initializer
|
| fully_specified_type IDENTIFIER '=' initializer
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
|
ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4);
|
||||||
ast_declarator_list *declarator = new(ctx) ast_declarator_list($1);
|
ast_declarator_list *declarator = new(ctx) ast_declarator_list($1);
|
||||||
decl->set_location(yylloc);
|
decl->set_location(yylloc);
|
||||||
@@ -1346,21 +1346,21 @@ case_label:
|
|||||||
iteration_statement:
|
iteration_statement:
|
||||||
WHILE '(' condition ')' statement_no_new_scope
|
WHILE '(' condition ')' statement_no_new_scope
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
|
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
|
||||||
NULL, $3, NULL, $5);
|
NULL, $3, NULL, $5);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| DO statement WHILE '(' expression ')' ';'
|
| DO statement WHILE '(' expression ')' ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
|
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
|
||||||
NULL, $5, NULL, $2);
|
NULL, $5, NULL, $2);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope
|
| FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
|
$$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
|
||||||
$3, $4.cond, $4.rest, $6);
|
$3, $4.cond, $4.rest, $6);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
@@ -1397,31 +1397,31 @@ for_rest_statement:
|
|||||||
jump_statement:
|
jump_statement:
|
||||||
CONTINUE ';'
|
CONTINUE ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
|
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| BREAK ';'
|
| BREAK ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
|
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| RETURN ';'
|
| RETURN ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
|
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| RETURN expression ';'
|
| RETURN expression ';'
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, $2);
|
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, $2);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
| DISCARD ';' // Fragment shader only.
|
| DISCARD ';' // Fragment shader only.
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
|
$$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
}
|
}
|
||||||
@@ -1435,7 +1435,7 @@ external_declaration:
|
|||||||
function_definition:
|
function_definition:
|
||||||
function_prototype compound_statement_no_new_scope
|
function_prototype compound_statement_no_new_scope
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
$$ = new(ctx) ast_function_definition();
|
$$ = new(ctx) ast_function_definition();
|
||||||
$$->set_location(yylloc);
|
$$->set_location(yylloc);
|
||||||
$$->prototype = $1;
|
$$->prototype = $1;
|
||||||
|
@@ -33,7 +33,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
|||||||
exec_list *instructions,
|
exec_list *instructions,
|
||||||
struct _mesa_glsl_parse_state *state)
|
struct _mesa_glsl_parse_state *state)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(state);
|
void *ctx = state;
|
||||||
ir_rvalue *result = NULL;
|
ir_rvalue *result = NULL;
|
||||||
ir_rvalue *op;
|
ir_rvalue *op;
|
||||||
|
|
||||||
|
@@ -191,7 +191,7 @@ scan_for_prototypes(_mesa_glsl_parse_state *st, exec_list *instructions,
|
|||||||
static ir_function *
|
static ir_function *
|
||||||
read_function(_mesa_glsl_parse_state *st, s_list *list, bool skip_body)
|
read_function(_mesa_glsl_parse_state *st, s_list *list, bool skip_body)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() < 3) {
|
if (list->length() < 3) {
|
||||||
ir_read_error(st, list, "Expected (function <name> (signature ...) ...)");
|
ir_read_error(st, list, "Expected (function <name> (signature ...) ...)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -235,7 +235,7 @@ static void
|
|||||||
read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list,
|
read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list,
|
||||||
bool skip_body)
|
bool skip_body)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 4) {
|
if (list->length() != 4) {
|
||||||
ir_read_error(st, list, "Expected (signature <type> (parameters ...) "
|
ir_read_error(st, list, "Expected (signature <type> (parameters ...) "
|
||||||
"(<instruction> ...))");
|
"(<instruction> ...))");
|
||||||
@@ -334,7 +334,7 @@ static ir_instruction *
|
|||||||
read_instruction(_mesa_glsl_parse_state *st, s_expression *expr,
|
read_instruction(_mesa_glsl_parse_state *st, s_expression *expr,
|
||||||
ir_loop *loop_ctx)
|
ir_loop *loop_ctx)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
s_symbol *symbol = SX_AS_SYMBOL(expr);
|
s_symbol *symbol = SX_AS_SYMBOL(expr);
|
||||||
if (symbol != NULL) {
|
if (symbol != NULL) {
|
||||||
if (strcmp(symbol->value(), "break") == 0 && loop_ctx != NULL)
|
if (strcmp(symbol->value(), "break") == 0 && loop_ctx != NULL)
|
||||||
@@ -376,7 +376,7 @@ read_instruction(_mesa_glsl_parse_state *st, s_expression *expr,
|
|||||||
static ir_variable *
|
static ir_variable *
|
||||||
read_declaration(_mesa_glsl_parse_state *st, s_list *list)
|
read_declaration(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 4) {
|
if (list->length() != 4) {
|
||||||
ir_read_error(st, list, "expected (declare (<qualifiers>) <type> "
|
ir_read_error(st, list, "expected (declare (<qualifiers>) <type> "
|
||||||
"<name>)");
|
"<name>)");
|
||||||
@@ -448,7 +448,7 @@ read_declaration(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_if *
|
static ir_if *
|
||||||
read_if(_mesa_glsl_parse_state *st, s_list *list, ir_loop *loop_ctx)
|
read_if(_mesa_glsl_parse_state *st, s_list *list, ir_loop *loop_ctx)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 4) {
|
if (list->length() != 4) {
|
||||||
ir_read_error(st, list, "expected (if <condition> (<then> ...) "
|
ir_read_error(st, list, "expected (if <condition> (<then> ...) "
|
||||||
"(<else> ...))");
|
"(<else> ...))");
|
||||||
@@ -480,7 +480,7 @@ read_if(_mesa_glsl_parse_state *st, s_list *list, ir_loop *loop_ctx)
|
|||||||
static ir_loop *
|
static ir_loop *
|
||||||
read_loop(_mesa_glsl_parse_state *st, s_list *list)
|
read_loop(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 6) {
|
if (list->length() != 6) {
|
||||||
ir_read_error(st, list, "expected (loop <counter> <from> <to> "
|
ir_read_error(st, list, "expected (loop <counter> <from> <to> "
|
||||||
"<increment> <body>)");
|
"<increment> <body>)");
|
||||||
@@ -508,7 +508,7 @@ read_loop(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_return *
|
static ir_return *
|
||||||
read_return(_mesa_glsl_parse_state *st, s_list *list)
|
read_return(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 2) {
|
if (list->length() != 2) {
|
||||||
ir_read_error(st, list, "expected (return <rvalue>)");
|
ir_read_error(st, list, "expected (return <rvalue>)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -564,7 +564,7 @@ read_rvalue(_mesa_glsl_parse_state *st, s_expression *expr)
|
|||||||
static ir_assignment *
|
static ir_assignment *
|
||||||
read_assignment(_mesa_glsl_parse_state *st, s_list *list)
|
read_assignment(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 4) {
|
if (list->length() != 4) {
|
||||||
ir_read_error(st, list, "expected (assign <condition> <lhs> <rhs>)");
|
ir_read_error(st, list, "expected (assign <condition> <lhs> <rhs>)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -599,7 +599,7 @@ read_assignment(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_call *
|
static ir_call *
|
||||||
read_call(_mesa_glsl_parse_state *st, s_list *list)
|
read_call(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 3) {
|
if (list->length() != 3) {
|
||||||
ir_read_error(st, list, "expected (call <name> (<param> ...))");
|
ir_read_error(st, list, "expected (call <name> (<param> ...))");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -644,7 +644,7 @@ read_call(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_expression *
|
static ir_expression *
|
||||||
read_expression(_mesa_glsl_parse_state *st, s_list *list)
|
read_expression(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
const unsigned list_length = list->length();
|
const unsigned list_length = list->length();
|
||||||
if (list_length < 4) {
|
if (list_length < 4) {
|
||||||
ir_read_error(st, list, "expected (expression <type> <operator> "
|
ir_read_error(st, list, "expected (expression <type> <operator> "
|
||||||
@@ -749,7 +749,7 @@ read_swizzle(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_constant *
|
static ir_constant *
|
||||||
read_constant(_mesa_glsl_parse_state *st, s_list *list)
|
read_constant(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 3) {
|
if (list->length() != 3) {
|
||||||
ir_read_error(st, list, "expected (constant <type> (<num> ... <num>))");
|
ir_read_error(st, list, "expected (constant <type> (<num> ... <num>))");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -840,7 +840,7 @@ read_dereference(_mesa_glsl_parse_state *st, s_expression *expr)
|
|||||||
static ir_dereference *
|
static ir_dereference *
|
||||||
read_var_ref(_mesa_glsl_parse_state *st, s_list *list)
|
read_var_ref(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 2) {
|
if (list->length() != 2) {
|
||||||
ir_read_error(st, list, "expected (var_ref <variable name>)");
|
ir_read_error(st, list, "expected (var_ref <variable name>)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -863,7 +863,7 @@ read_var_ref(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_dereference *
|
static ir_dereference *
|
||||||
read_array_ref(_mesa_glsl_parse_state *st, s_list *list)
|
read_array_ref(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 3) {
|
if (list->length() != 3) {
|
||||||
ir_read_error(st, list, "expected (array_ref <rvalue> <index>)");
|
ir_read_error(st, list, "expected (array_ref <rvalue> <index>)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -884,7 +884,7 @@ read_array_ref(_mesa_glsl_parse_state *st, s_list *list)
|
|||||||
static ir_dereference *
|
static ir_dereference *
|
||||||
read_record_ref(_mesa_glsl_parse_state *st, s_list *list)
|
read_record_ref(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
if (list->length() != 3) {
|
if (list->length() != 3) {
|
||||||
ir_read_error(st, list, "expected (record_ref <rvalue> <field>)");
|
ir_read_error(st, list, "expected (record_ref <rvalue> <field>)");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -920,7 +920,7 @@ valid_texture_list_length(ir_texture_opcode op, s_list *list)
|
|||||||
static ir_texture *
|
static ir_texture *
|
||||||
read_texture(_mesa_glsl_parse_state *st, s_list *list)
|
read_texture(_mesa_glsl_parse_state *st, s_list *list)
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(st);
|
void *ctx = st;
|
||||||
s_symbol *tag = SX_AS_SYMBOL(list->subexpressions.head);
|
s_symbol *tag = SX_AS_SYMBOL(list->subexpressions.head);
|
||||||
assert(tag != NULL);
|
assert(tag != NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user