On 12/15/22 13:00, Arsen Arsenović wrote:
Hi Jason,

Jason Merrill <ja...@redhat.com> 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_name instead of write_encoding?  The demangler
already expects "clone" suffixes at the end of the mangled name.

Ah, sorry.  I'm not well versed in the mangler code, so I didn't realize
(frankly, I was initially surprised when I saw that DECL_ASSEMBLER_NAME
was set that early, but went with it).  That makes sense.

How about this?  Tested on x86_64-pc-linux-gnu via check-g++.



I did run c++filt (afaik, it uses the libiberty demangler) on this
revision, and I got:

           .type        f(int) [clone .pre], @function
   f(int) [clone .pre]:

out of ``void f(int x) [[ pre: x > 10 ]] {}'', which seems to match your
description.

If I understand this right, write_xxx corresponds to xxx in the Itanium
ABI mangling BNF, in which case, I believe I have the correct spot here.
In that case, a similar change should happen for coroutines; I think
Iain was working on that.

        * mangle.cc (write_encoding): Move contract pre/post function mangling

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

Reply via email to