mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[qfcc] Set struct member ids
The id matches the member's order in the struct's fields (needed for spir-v access chains).
This commit is contained in:
parent
14f428a81d
commit
52d38ce8a6
1 changed files with 4 additions and 0 deletions
|
@ -171,6 +171,7 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, const type_t *type,
|
||||||
error (0, "%s defined as wrong kind of tag", tag->name);
|
error (0, "%s defined as wrong kind of tag", tag->name);
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
int index = 0;
|
||||||
for (s = symtab->symbols; s; s = s->next) {
|
for (s = symtab->symbols; s; s = s->next) {
|
||||||
if (s->sy_type != sy_offset)
|
if (s->sy_type != sy_offset)
|
||||||
continue;
|
continue;
|
||||||
|
@ -214,10 +215,13 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, const type_t *type,
|
||||||
s->offset += offset;
|
s->offset += offset;
|
||||||
s->table = symtab;
|
s->table = symtab;
|
||||||
s->no_auto_init = true;
|
s->no_auto_init = true;
|
||||||
|
s->id = index++;
|
||||||
Hash_Add (symtab->tab, s);
|
Hash_Add (symtab->tab, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s->next = t;
|
s->next = t;
|
||||||
|
} else {
|
||||||
|
s->id = index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!type)
|
if (!type)
|
||||||
|
|
Loading…
Reference in a new issue