mescc: Tinycc support: sizeof (struct.field).

* module/language/c99/compiler.mes (expr->accu): Support sizeof (struct.field).
This commit is contained in:
Jan Nieuwenhuizen 2017-07-23 14:18:00 +02:00
parent 1d996c7131
commit 2756dd9071
1 changed files with 5 additions and 0 deletions

View File

@ -526,6 +526,11 @@
(size (field-size info type field)))
(append-text info (wrap-as (i386:value->accu size)))))
((sizeof-expr (d-sel (ident ,field) (p-expr (ident ,struct))))
(let* ((type (ident->type info struct))
(size (field-size info type field)))
(append-text info (wrap-as (i386:value->accu size)))))
((sizeof-type (type-name (decl-spec-list (type-spec (fixed-type ,name)))))
(let* ((type name)
(size (ast-type->size info type)))