[PATCH] D94154: Unique Internal Linkage Name suffixes must be demangler friendly

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 09:44:33 PST 2021


tmsriram added a comment.

In D94154#2481491 <https://reviews.llvm.org/D94154#2481491>, @dblaikie wrote:

> This is only demangler friendly if the name is already an itanium mangled name, right? (ie: the name starts with _Z) So it wouldn't work for C code?

Right.  But in this case, a DW_AT_linkage_name is never generated.  The DW_AT_name uses the C style symbol name.  This proves we should not force a DW_AT_linkage_name with uniqueified names if the field was null to begin with, does that resolve this problem?  In the "overloadable" scenario, the linkage name is mangled so there is no problem.

> Do you have plans to fix this more generally? (I think to fix it more generally, you might need to move this feature up to clang and have clang mangle the name then add the suffix (at least for itanium mangling - not sure if windows mangling supports arbitrary suffixes like this, @rnk might know) - that way for C functions you can force/enable the mangling as is done for __attribute__((overloadable)) and others (I think __attribute__((enable_if)) also causes mangling of C functions))
>
>> ! In D94154#2481491 <https://reviews.llvm.org/D94154#2481491>, @dblaikie wrote:
>
> This is only demangler friendly if the name is already an itanium mangled name, right? (ie: the name starts with _Z) So it wouldn't work for C code?
>
> Do you have plans to fix this more generally? (I think to fix it more generally, you might need to move this feature up to clang and have clang mangle the name then add the suffix (at least for itanium mangling - not sure if windows mangling supports arbitrary suffixes like this, @rnk might know) - that way for C functions you can force/enable the mangling as is done for __attribute__((overloadable)) and others (I think __attribute__((enable_if)) also causes mangling of C functions))




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94154/new/

https://reviews.llvm.org/D94154



More information about the llvm-commits mailing list