glsl: Add method to determine whether an expression contains the sequence operator
This will be used in the next patch to enforce some language sematics. v2: Fix inverted logic in ast_function_expression::has_sequence_subexpression. The method originally had a different name and a different meaning. I fixed the logic in ast_to_hir.cpp, but I only changed the names in ast_function.cpp. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com> [v1] Reviewed-by: Matt Turner <mattst88@gmail.com> Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
@@ -1999,6 +1999,17 @@ ast_function_expression::hir(exec_list *instructions,
|
||||
unreachable("not reached");
|
||||
}
|
||||
|
||||
bool
|
||||
ast_function_expression::has_sequence_subexpression() const
|
||||
{
|
||||
foreach_list_typed(const ast_node, ast, link, &this->expressions) {
|
||||
if (ast->has_sequence_subexpression())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ir_rvalue *
|
||||
ast_aggregate_initializer::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
|
||||
Reference in New Issue
Block a user