mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[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.
This commit is contained in:
parent
ae0cfe47cc
commit
21eed88da5
1 changed files with 2 additions and 1 deletions
|
@ -1944,9 +1944,10 @@ spirv_declare_sym (specifier_t spec, const expr_t *init, symtab_t *symtab,
|
||||||
if (sym->name[0]) {
|
if (sym->name[0]) {
|
||||||
symtab_addsymbol (symtab, sym);
|
symtab_addsymbol (symtab, sym);
|
||||||
}
|
}
|
||||||
if (symtab->type == stab_local) {
|
if (symtab->type == stab_param || symtab->type == stab_local) {
|
||||||
if (init) {
|
if (init) {
|
||||||
if (!block && is_constexpr (init)) {
|
if (!block && is_constexpr (init)) {
|
||||||
|
printf ("!block %s\n", sym->name);
|
||||||
} else if (block) {
|
} else if (block) {
|
||||||
auto r = new_symbol_expr (sym);
|
auto r = new_symbol_expr (sym);
|
||||||
auto e = assign_expr (r, init);
|
auto e = assign_expr (r, init);
|
||||||
|
|
Loading…
Reference in a new issue