[demangler] Fix demangling of 'half'
authorStuart Brady <stuart.brady@arm.com>
Mon, 7 Jun 2021 15:30:22 +0000 (16:30 +0100)
committerStuart Brady <stuart.brady@arm.com>
Mon, 19 Jul 2021 20:21:34 +0000 (21:21 +0100)
Demangle 'Dh' as 'half' (as per GCC), and not 'decimal16' (which doesn't
make sense, as there is no IEEE 754 decimal16 format).

The Itanium C++ ABI specification describes 'Dh' as:
> IEEE 754r half-precision floating point (16 bits)

(https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin)

Reviewed By: ldionne, jyknight

Differential Revision: https://reviews.llvm.org/D103833

libcxxabi/src/demangle/ItaniumDemangle.h
llvm/include/llvm/Demangle/ItaniumDemangle.h

index 9e6ae75eda7bb1ceb3e349ba4d530b63de9a63c9..36d5d1adeca07cd70ffe2f6b236a6785c30511b1 100644 (file)
@@ -3883,7 +3883,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
     //                ::= Dh   # IEEE 754r half-precision floating point (16 bits)
     case 'h':
       First += 2;
-      return make<NameType>("decimal16");
+      return make<NameType>("half");
     //                ::= Di   # char32_t
     case 'i':
       First += 2;
index 300be2bc74867a054ddaec23c6225c02c1bb0cd0..9163b713d1185cafe6a5f6883b912e44ce41a0ae 100644 (file)
@@ -3883,7 +3883,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
     //                ::= Dh   # IEEE 754r half-precision floating point (16 bits)
     case 'h':
       First += 2;
-      return make<NameType>("decimal16");
+      return make<NameType>("half");
     //                ::= Di   # char32_t
     case 'i':
       First += 2;