[cxx-abi-dev] Mangling "transaction-safe function"
John McCall
rjmccall at apple.com
Wed Sep 30 17:31:26 UTC 2015
> On Sep 29, 2015, at 8:42 PM, Jason Merrill <jason at redhat.com> wrote:
> On 09/29/2015 11:27 PM, Jason Merrill wrote:
>> On 09/29/2015 08:34 PM, Richard Smith wrote:
>>> On 29 September 2015 at 11:09, Jason Merrill <jason at redhat.com> wrote:
>>>
>>>> The Transactional Memory TS introduces "transaction-safe function"
>>>> types,
>>>> which are distinct from non-transaction-safe function types, though the
>>>> former converts to the latter. So we need to represent this in
>>>> mangling.
>>>>
>>>> I think no change to mangling of actual functions is necessary, since
>>>> functions that differ only in their tx-qualifier cannot be overloaded.
>>>
>>> I thought the intent was that we'd emit two function bodies for a
>>> transaction-safe function definition (one for the case where we are
>>> inside
>>> an atomic block, another for the case where we are not). Do we also
>>> need a
>>> new function mangling for the former case?
>>
>> Yes, I thought I had mentioned that in a follow-up, but evidently not.
>> GCC currently mangles the transaction entry point as
>>
>> <special_name> ::= GTt <encoding>
>>
>>>> So we only need to worry about function types.
>>>>
>>>> One possibility for handling it would be to add a qualifier 'T' after
>>>> the
>>>> <ref-qualifier> at the end of <function-type>, but that complicates the
>>>> ambiguity between these qualifiers and parameter types.
>>>>
>>>> I think my preference is to make it a normal type qualifier, perhaps
>>>> using "Dx", so void (*)() transaction_safe becomes "PDxFvvE".
>
> There's also the question of whether the non-transaction-safe function type is substitutable in this mangling. I think we might as well allow it, as we do for cv-qualified types.
Hmm. To me, this seems much more like a ref-qualifier or a cv method qualifier, which we do not make independently substitutable.
John.
More information about the cxx-abi-dev
mailing list