[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 21:36:34 +0330 |
> > +/* 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.
[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