|
| From: | Jose E. Marchesi |
| Subject: | Re: [PATCH 3/5] pkl: Fix pkl_ast_{sizeof_type,is_complete} |
| Date: | Sun, 23 Jan 2022 19:09:03 +0100 |
| User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> > +/* Calculate the size of struct type fields that are complete. */
>> > +
>> > +PKL_PHASE_BEGIN_HANDLER (pkl_trans2_ps_struct_type_field)
>> > +{
>> > + pkl_ast_node field = PKL_PASS_NODE;
>> > + pkl_ast_node field_type = PKL_AST_STRUCT_TYPE_FIELD_TYPE (field);
>> > +
>> > + if (pkl_ast_type_is_complete (field_type) == PKL_AST_TYPE_COMPLETE_YES)
>> > + {
>> > + PKL_AST_STRUCT_TYPE_FIELD_SIZE (field)
>> > + = ASTREF (pkl_ast_sizeof_type (PKL_PASS_AST, field_type));
>> > + PKL_PASS_RESTART = 1;
>>
>> Why that restart?
>>
>
> To constant-fold the SIZE node, we've just created.
Ok.
| [Prev in Thread] | Current Thread | [Next in Thread] |