[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/5] pkl: Fix pkl_ast_{sizeof_type,is_complete}
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [PATCH 3/5] pkl: Fix pkl_ast_{sizeof_type,is_complete} |
Date: |
Sun, 23 Jan 2022 23:55:09 +0330 |
On Sun, Jan 23, 2022 at 07:09:03PM +0100, Jose E. Marchesi wrote:
>
> >> > +/* 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.
>
Pushed to master.
Thanks!
[PATCH 4/5] pkl: Add folding for array add operation, Mohammad-Reza Nabipoor, 2022/01/22
[PATCH 5/5] pkl: Compute attributes at compile-time whenever possible, Mohammad-Reza Nabipoor, 2022/01/22
Re: [PATCH 1/5] pkl: Postpone decision of completeness of a struct literals, Jose E. Marchesi, 2022/01/23