[libcxx-commits] [PATCH] D74163: [demangler] Fix the parsing of long double literals for PowerPC and S390

Xing Xue via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 13 12:26:19 PDT 2020


xingxue marked 7 inline comments as done.
xingxue added inline comments.


================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:3793
+  //                ::= g    # long double, __float128
+#if defined(__powerpc__) || defined(__s390__)
+  case 'g':
----------------
hubert.reinterpretcast wrote:
> I do not believe this change is necessary at this time. On `powerpc64le-linux-gnu` even with `-mlong-double-128`,
> `_Z1fIiEvP1AIXszplLg00000000000000004000000000000000EcvT__EEE`
> demangles using
> `__cxa_demangle` picked up using `-lsupc++`
> as
> `void f<int>(A<sizeof (((__float128)[00000000000000004000000000000000])+((int)()))>*)`.
> 
> Similarly, the same with
> `_Z1fIiEvP1AIXszplLg40000000000000000000000000000000EcvT__EEE`
> on `s390x-linux-gnu` gives
> `void f<int>(A<sizeof (((__float128)[40000000000000000000000000000000])+((int)()))>*)`.
> 
The change is not needed with the handling of type code `g` unchanged as suggested.


================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:4236
+    return getDerived().template parseFloatingLiteral<double>();
+  case 'g':
+    ++First;
----------------
hubert.reinterpretcast wrote:
> I'm going to suggest leaving `g` alone.
Agreed.


================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:5192
 #endif
     static const size_t max_demangled_size = 40;
     static constexpr const char *spec = "%LaL";
----------------
hubert.reinterpretcast wrote:
> This is not going to be long enough for IBM double-double, which can have a large gap between the high and the low doubles.
Leave it unchanged for now since the current handling of IBM double-double prints the raw byte string in hex. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74163





More information about the libcxx-commits mailing list