poke-devel
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]