From 21eed88da5ba32e5fda5b67239e9c50250e717b9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 12 Dec 2024 00:39:09 +0900 Subject: [PATCH] [qfcc] Allow initializers in param symtabs for spir-v This gets the incoming parameters initialized, though currently rather suboptimally (but that's due to the setup of the call). Next, just need to handle `return` in inline functions. --- tools/qfcc/source/target_spirv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/target_spirv.c b/tools/qfcc/source/target_spirv.c index 0db7878de..ef0808e8d 100644 --- a/tools/qfcc/source/target_spirv.c +++ b/tools/qfcc/source/target_spirv.c @@ -1944,9 +1944,10 @@ spirv_declare_sym (specifier_t spec, const expr_t *init, symtab_t *symtab, if (sym->name[0]) { symtab_addsymbol (symtab, sym); } - if (symtab->type == stab_local) { + if (symtab->type == stab_param || symtab->type == stab_local) { if (init) { if (!block && is_constexpr (init)) { + printf ("!block %s\n", sym->name); } else if (block) { auto r = new_symbol_expr (sym); auto e = assign_expr (r, init);