llvm-cxxfilt build configurations can show formatting differences for floating point literals
namespace cxx20 {
template<auto> struct A {};
void f(A<1.0>) {}
};
Is mangled as _ZN5cxx201fENS_1AILd3ff0000000000000EEE.
For a Visual Studio 2019 build llvm-cxxfilt demangles as cxx20::f(cxx20::A<0x1.0000000000000p+0>) however for a Linux build with glibc it is demanged as: cxx20::f(cxx20::A<0x1p+0>). This occurs as the implementation calls snprintf and the differing implementations have minor output variations. See: https://github.com/llvm/llvm-project/blob/023cdfcc1a5bdef7f12bb6da9328f93b477c38b8/llvm/include/llvm/Demangle/ItaniumDemangle.h#L2575
Ideally, the output of llvm-cxxfilt should be consistent.
One solution might be just to dump the hexadecimal string from the mangled name. This would match what GNU appears to do. For example GNU cxxfilt demangles to: cxx20::f(cxx20::A<(double)[3ff0000000000000]>). See: https://github.com/llvm/llvm-project/issues/92081 for, possibly, more motivation for just dumping the hexadecimal string.
@llvm/issue-subscribers-tools-llvm-cxxfilt
Author: bd1976bris (bd1976bris)
For a Visual Studio 2019 build llvm-cxxfilt demangles as cxx20::f(cxx20::A<0x1.0000000000000p+0>) however for a Linux build with glibc it is demanged as: cxx20::f(cxx20::A<0x1p+0>). This occurs as the implementation calls snprintf and the differing implementations have minor output variations. See: https://github.com/llvm/llvm-project/blob/023cdfcc1a5bdef7f12bb6da9328f93b477c38b8/llvm/include/llvm/Demangle/ItaniumDemangle.h#L2575
Ideally, the output of the llvm-cxxfilt should be consistent.
One solution might be just to dump the hexadecimal string from the mangled name. This would match what GNU appears to do. For example GNU cxxfilt demangles to: cxx20::f(cxx20::A<(double)[3ff0000000000000]>). See: https://github.com/llvm/llvm-project/issues/92081 for, possibly, more motivation for just dumping the hexadecimal string.