-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[abi] mangled name for constrained template is not demangled by llvm-cxxfilt #89914
Comments
@llvm/issue-subscribers-clang-frontend Author: Haojian Wu (hokein)
Example:
Clang generates mangled name It looks like something wrong with the constrain PS. gcc trunk generates a different name |
Looks like Clang mangles constraints with
Which isn't standardised yet. We're just missing support for this new grammar in the libcxxabi demangler. EDIT: Ah nvm, wasn't looking at the right place in the demangler. We are supposed to handle |
I think we have some supports for template constraints in the demangler, see https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5738. Interestingly, the demangler works for the following code, where the mangled name is
|
Issue seems to be that the reference |
Thanks!
(assuming the mangled name is generated correctly) it sounds plausible. IIUC, it looks like an issue about template parameter backreferencing -- the |
But it seems that the current mangling expects that template references in constraints refer back to the template parameters of the template in which the constraint appears. Consider |
…traint expression. This prevents demangler failures until the TODO in the [demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678) is implemented. This is a temporary fix for [llvm#89914](llvm#89914).
…traint expression. This prevents demangler failures until the TODO in the [demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678) is implemented. This is a temporary fix for [llvm#89914](llvm#89914).
…constraint expression (#107385) This prevents demangler failures until the TODO in the [demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678) is implemented. This is a temporary fix for [#89914](#89914).
Re-opened the issue, since I still intend to work on the proper demangling for contrained parameters. Regarding resetting template parameter levels, here's the shortest example we have so far:
It mangles to Z3bar7FuncRefIXadL_ZN3FooIiE3BarIbE3bazIcQ4TrueIT_EEEvvEEES_IXadL_ZN7FooNextIiE3BarIbE6foobarIcQ4TrueITL0__EEEvvEEE. Note how |
@llvm/issue-subscribers-tools-llvm-cxxfilt Author: Haojian Wu (hokein)
Example:
Clang generates mangled name It looks like something wrong with the constrain PS. gcc trunk generates a different name |
We have discussed this in more detail with @zygoloid, who has provided compelling arguments for not demangling template parameter levels into specific types. Consider the mangled names
In the current version of the demangler, they would demangle to
If we implement the level demangling, both demanglings would become
which seems less useful. |
Example:
Clang generates mangled name
_ZN3FooIiE6methodITk4TrueIT_EiEEvS3_
for the template specializationFoo<int>::method
. However this mangled name can not be demangled by the official toolllvm-cxxfilt
.It looks like something wrong with the constrain
True
part.PS. gcc trunk generates a different name
_ZN3FooIiE6methodIiEEvT_
, which can be demangled, but it doesn't contain the constraint.The text was updated successfully, but these errors were encountered: