Re: [PATCH] Add a simulate_record_decl lang hook

2021-11-01 Thread Jason Merrill via Gcc-patches
On Sat, Oct 30, 2021 at 2:29 PM Richard Sandiford wrote: > Jason Merrill writes: > > On 10/18/21 16:35, Richard Sandiford wrote: > >> Jason Merrill writes: > >>> On 9/24/21 13:53, Richard Sandiford wrote: > + if (type == error_mark_node) > +return lhd_simulate_record_decl (loc, n

Re: [PATCH] Add a simulate_record_decl lang hook

2021-10-30 Thread Richard Sandiford via Gcc-patches
Jason Merrill writes: > On 10/18/21 16:35, Richard Sandiford wrote: >> Jason Merrill writes: >>> On 9/24/21 13:53, Richard Sandiford wrote: + if (type == error_mark_node) +return lhd_simulate_record_decl (loc, name, fields); >>> >>> Why fall back to the language-independent functio

Re: [PATCH] Add a simulate_record_decl lang hook

2021-10-19 Thread Jason Merrill via Gcc-patches
On 10/18/21 16:35, Richard Sandiford wrote: Jason Merrill writes: On 9/24/21 13:53, Richard Sandiford wrote: + if (type == error_mark_node) +return lhd_simulate_record_decl (loc, name, fields); Why fall back to the language-independent function on error? Is there a case where that give

Re: [PATCH] Add a simulate_record_decl lang hook

2021-10-18 Thread Richard Sandiford via Gcc-patches
Jason Merrill writes: > On 9/24/21 13:53, Richard Sandiford wrote: >> This patch adds a lang hook for defining a struct/RECORD_TYPE >> “as if” it had appeared directly in the source code. It follows >> the similar existing hook for enums. >> >> It's the caller's responsibility to create the fiel

Re: [PATCH] Add a simulate_record_decl lang hook

2021-10-15 Thread Jason Merrill via Gcc-patches
On 9/24/21 13:53, Richard Sandiford wrote: This patch adds a lang hook for defining a struct/RECORD_TYPE “as if” it had appeared directly in the source code. It follows the similar existing hook for enums. It's the caller's responsibility to create the fields (as FIELD_DECLs) but the hook's res