Open ee71566f-843d-4d3b-a2a1-44c98686870e opened 4 years ago
Thanks.
Regarding the remaining cases in your gist: I think a big factor in the "much larger in llvm-cxxfilt" might be that llvm-cxxfilt has a more verbose demangling for lambda-expressions. It'd be interesting to know if most of the "much larger" cases have "lambda" in their demangling...
Thanks for the detailed explanation. I opened a bug here [1] to hopefully address the incorrect behavior of the g++ mangler.
Different demanglings are not a bug per se; the goal of both tools is to produce human-readable names, and there's more than one way to do that. (We might want to look at the cases where llvm-cxxfilt produces longer demanglings, though.)
The differing behavior of demangling
_ZN3caf12config_value3setINS_3uriEEENSt9enable_ifIXsrNS_6detail9is_one_ofIT_JdNS_10atom_valueENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEES2_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS0_SaIS0_EENS_10dictionaryIS0EEEEE5valueEvE4typeES6
is definitely a bug in one of the two demanglers. They are registering different substitutions as they demangle, as follows:
For c++filt:
S: caf
S0: caf::configvalue
S1: caf::configvalue::set
S2: caf::uri
S3_: std::enableif
// ---
S4: caf::detail
S5_: caf::detail::is_oneof
// ---
S6: caf::uri
S7_: caf::atomvalue
S8: std::chrono
S9: std::chrono::duration
SA: std::ratio
SB: std::ratio<1l, 1000000000l>
SC: std::chrono::duration<long, std::ratio<1l, 1000000000l> >
SD_: std::cxx11
SE_: std::__cxx11::basicstring
SF: std::chartraits
SG: std::chartraits
For llvm-cxxfilt:
S: caf
S0: caf::configvalue
S1: caf::configvalue::set
S2: caf::uri
S3_: std::enableif
// ---
S4: caf::uri
S5_: caf::atomvalue
S6: std::chrono
S7: std::chrono::duration
S8: std::ratio
S9: std::ratio<1l, 1000000000l>
SA: std::chrono::duration<long, std::ratio<1l, 1000000000l> >
SB_: std::cxx11
SC_: std::__cxx11::basicstring
SD: std::chartraits
SE: std::chartraits
So, c++filt is registering 3 additional substitutions for srNS_6detail9is_oneofIT...:
Per the mangling specification (http://itanium-cxx-abi.github.io/cxx-abi/abi.html), we have:
Extended Description
Mangled names from a working open source project and steps to reproduce can be found here [1].
P.S. Why is the tool called llvm-cxxfilt in real life, but llvm-c++filt in this bug system?
[1] https://gist.github.com/simonhf/0d60bb94f2d90c1b32e4786b2d1062ad