From 9060981c10c21834596d5677a2c9ccc56809eb64 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 8 Mar 2022 15:49:01 +0100 Subject: 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'. --- rv64/abi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rv64') diff --git a/rv64/abi.c b/rv64/abi.c index 05deabe..b49057b 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -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 */ -- cgit 1.4.1