[llvm] 87039c0 - [demangler] Fix demangling of 'half'

Stuart Brady via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 13:23:21 PDT 2021


Author: Stuart Brady
Date: 2021-07-19T21:21:34+01:00
New Revision: 87039c048c0cbc3d8cbba86187269b006bf2f373

URL: https://github.com/llvm/llvm-project/commit/87039c048c0cbc3d8cbba86187269b006bf2f373
DIFF: https://github.com/llvm/llvm-project/commit/87039c048c0cbc3d8cbba86187269b006bf2f373.diff

LOG: [demangler] Fix demangling of 'half'

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 9e6ae75eda7bb..36d5d1adeca07 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -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;

diff  --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 300be2bc74867..9163b713d1185 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -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;


        


More information about the llvm-commits mailing list