Moved examples around. Updated (and corrected) const initialization. Removed "in" keyword. Added "member" attribute domain. Many fixes in struct padding and alignment and tests. Fixed extern global.

This commit is contained in:
Christoffer Lerno
2021-01-24 00:52:48 +01:00
committed by Christoffer Lerno
parent 564c93700e
commit 3a24fbfa6d
67 changed files with 1930 additions and 671 deletions

View File

@@ -186,7 +186,7 @@ ByteSize type_size(Type *type)
case TYPE_ENUM:
return type->decl->enums.type_info->type->canonical->builtin.bytesize;
case TYPE_ERRTYPE:
return alignment_error_code;
return type_size(type_usize->canonical);
case TYPE_STRUCT:
case TYPE_UNION:
assert(type->decl->resolve_status == RESOLVE_DONE);
@@ -607,7 +607,7 @@ AlignSize type_abi_alignment(Type *type)
case TYPE_ENUM:
return type->decl->enums.type_info->type->canonical->builtin.abi_alignment;
case TYPE_ERRTYPE:
return alignment_error_code;
return t_usz.canonical->builtin.abi_alignment;
case TYPE_STRUCT:
case TYPE_UNION:
return type->decl->alignment;