Decl *new_decl_aggregate(SrcPos pos, DeclKind kind, char *name, Aggregate *aggregate) { assert(kind == DECL_STRUCT || kind == DECL_UNION); Decl *d = new_decl(kind, pos, name); d->aggregate = aggregate; return(d); }
Aggregate *new_aggregate(SrcPos pos, AggregateKind kind, AggregateItem *items, int num_items) { Aggregate *aggregate = (Aggregate *)ast_alloc(sizeof(Aggregate)); aggregate->pos = pos; aggregate->kind = kind; aggregate->items = items; aggregate->num_items = num_items; return(aggregate); }