flag types defined as unions

The risc-v abi needs to know if a
type is defined as a union or not.

We cannot use nunion to obtain this
information because the risc-v abi
made the unfortunate decision of
treating

	union { int i; }

differently from

	int i;

So, instead, I introduce a single
bit flag 'isunion'.
This commit is contained in:
Quentin Carbonneaux 2022-03-08 15:49:01 +01:00
parent 349794f3e4
commit 9060981c10
5 changed files with 11 additions and 8 deletions

View file

@ -105,7 +105,7 @@ typclass(Class *c, Typ *t, int *gp, int *fp)
if (t->align > 4)
err("alignments larger than 16 are not supported");
if (t->dark || sz > 16 || sz == 0) {
if (t->isdark || sz > 16 || sz == 0) {
/* large structs are replaced by a
* pointer to some caller-allocated
* memory */