From 0fd665ca63ba37b9a3022f21a8d9f363530e2038 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 30 Oct 2010 22:29:07 -0700 Subject: [PATCH] ir_reader: Return a specific ir_dereference variant. There's really no reason to return the base class when we have more specific information about what type it is. --- src/glsl/ir_reader.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index a9cbf8ea944..99e25855d05 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -64,9 +64,12 @@ static ir_texture *read_texture(_mesa_glsl_parse_state *, s_list *); static ir_dereference *read_dereference(_mesa_glsl_parse_state *, s_expression *); -static ir_dereference *read_var_ref(_mesa_glsl_parse_state *, s_list *); -static ir_dereference *read_array_ref(_mesa_glsl_parse_state *, s_list *); -static ir_dereference *read_record_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_variable * +read_var_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_array * +read_array_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_record * +read_record_ref(_mesa_glsl_parse_state *, s_list *); void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, @@ -930,7 +933,7 @@ read_dereference(_mesa_glsl_parse_state *st, s_expression *expr) return NULL; } -static ir_dereference * +static ir_dereference_variable * read_var_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; @@ -953,7 +956,7 @@ read_var_ref(_mesa_glsl_parse_state *st, s_list *list) return new(ctx) ir_dereference_variable(var); } -static ir_dereference * +static ir_dereference_array * read_array_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; @@ -974,7 +977,7 @@ read_array_ref(_mesa_glsl_parse_state *st, s_list *list) return new(ctx) ir_dereference_array(subject, idx); } -static ir_dereference * +static ir_dereference_record * read_record_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; -- 2.30.2