Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-17 Thread Arsen Arsenović via Gcc-patches
Iain Sandoe writes: > I think you want to use 'write_string (JOIN_STR “pre”);’ etc. since that > handles targets > that cannot use a period in symbol names. Ah - I think you're right. I'll have to delay checking/fixing for now. Thanks for the note. > If this is the right place, then I can up

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-17 Thread Arsen Arsenović via Gcc-patches
Jason Merrill writes: > > It's best to wrap the ChangeLog entry at column 75 so that the extra > indentation added by git log doesn't push past column 80. > > Applied with that change. > > Jason Heh, I thought I fixed my fill-column. Will check. Thanks! Have a great day. -- Arsen Arsenović

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-15 Thread Jason Merrill via Gcc-patches
On 12/15/22 13:00, Arsen Arsenović wrote: Hi Jason, Jason Merrill writes: On 12/10/22 08:13, Arsen Arsenović wrote: If the mangler is relied on, functions with extern "C" on them emit multiple definitions of the same name. But doing it here interferes with lazy mangling. How about appendi

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-15 Thread Iain Sandoe
Hi Arsen, > On 15 Dec 2022, at 18:00, Arsen Arsenović via Gcc-patches > wrote: > Jason Merrill writes: > >> On 12/10/22 08:13, Arsen Arsenović wrote: >>> If the mangler is relied on, functions with extern "C" on them emit multiple >>> definitions of the same name. >> >> But doing it here int

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-15 Thread Arsen Arsenović via Gcc-patches
Hi Jason, Jason Merrill writes: > On 12/10/22 08:13, Arsen Arsenović wrote: >> If the mangler is relied on, functions with extern "C" on them emit multiple >> definitions of the same name. > > But doing it here interferes with lazy mangling. How about appending the > suffix into write_mangled_n

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-15 Thread Jason Merrill via Gcc-patches
On 12/10/22 08:13, Arsen Arsenović wrote: If the mangler is relied on, functions with extern "C" on them emit multiple definitions of the same name. But doing it here interferes with lazy mangling. How about appending the suffix into write_mangled_name instead of write_encoding? The demangl

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-11 Thread Arsen Arsenović via Gcc-patches
Hi Bernhard, Bernhard Reutner-Fischer writes: > From a very distant POV this auto sounds really like an ugly bandaid and I, > personally would have used a conditional in place argument. auto is really > like > c++ didn't have the guts to go straight to implicit typed LHS like python et > al >

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-10 Thread Bernhard Reutner-Fischer via Gcc-patches
Hi Arsen, On 10 December 2022 14:14:59 CET, "Arsen Arsenović via Gcc-patches" wrote: > >Arsen Arsenović writes: > >> Afternoon, >> >> This change prevents contracts from emitting wrapper functions that have the >> same name as the original function, by moving the logic that disambiguates >> th

Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-10 Thread Arsen Arsenović via Gcc-patches
Arsen Arsenović writes: > Afternoon, > > This change prevents contracts from emitting wrapper functions that have the > same name as the original function, by moving the logic that disambiguates > them > from the mangler into the build_contract_condition_function helper. > > Thanks, have nice d

[PATCH] contracts: Stop relying on mangling for naming .pre/.post clones

2022-12-10 Thread Arsen Arsenović via Gcc-patches
If the mangler is relied on, functions with extern "C" on them emit multiple definitions of the same name. gcc/cp/ChangeLog: * contracts.cc (build_contract_condition_function): Add pre/post suffixes to pre- and postcondition clones. * mangle.cc (write_encoding): Don't mang