mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-15 06:58:20 +02:00
ir3/parser: add helper to generate syntax errors based on gen
The assembly syntax of certain instructions differs significantly between generations (e.g., ldg.a/stg.a) so it's useful to be able to generate syntax error based on the generation we are assembling for. Signed-off-by: Job Noorman <jnoorman@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33503>
This commit is contained in:
parent
605f94520f
commit
5a8193e657
1 changed files with 9 additions and 0 deletions
|
|
@ -320,6 +320,15 @@ static void yyerror(const char *error)
|
|||
fprintf(stderr, "error at line %d: %s\n%s\n", ir3_yyget_lineno(), error, current_line);
|
||||
}
|
||||
|
||||
/* Needs to be a macro to use YYERROR */
|
||||
#define illegal_syntax_from(gen_from, error) \
|
||||
do { \
|
||||
if (variant->compiler->gen >= gen_from) { \
|
||||
yyerror(error); \
|
||||
YYERROR; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
struct ir3 * ir3_parse(struct ir3_shader_variant *v,
|
||||
struct ir3_kernel_info *k, FILE *f)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue