[libcxx-commits] [PATCH] D77924: ld128 demangle: allow space for 'L' suffix.

Erik Pilkington via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 30 16:48:20 PDT 2020


erik.pilkington added a comment.

In D77924#2186005 <https://reviews.llvm.org/D77924#2186005>, @efriedma wrote:

> It looks like the behavior here is host-dependent (we demangle the target's long double literals based on the host's long double).  Is that correct?  Should we try to avoid that?  It seems like a bad idea to make llvm-cxxfilt behave differently on different targets.

This code predates my involvement in the demangler, and I agree that its unfortunate to have different output depending on the host, but I think this approach (deferring to the host's printf) is kinda reasonable. My understanding is that floating point literals are encoded using the bytes of their internal representation (https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling.literal), and we don't know what the encoding is from the mangled name, all we can know is the builtin C++ type and the size of the encoding in bytes. We could potentially try to use that as a heuristic (e.g. 10 bytes probably means x87), but I'm not sure if that would always give the right answer (?), and it would mean that we'd have to write our own floating-point printers for other representations in libcxxabi, which sounds like a pain. WDYT?

(Regardless though, I think we should land this crash-fix.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77924



More information about the libcxx-commits mailing list