diff options
| author | Fraser Cormack <fraser@codeplay.com> | 2025-01-13 21:15:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-13 16:15:40 -0500 |
| commit | a100fd8cbd3dad3846a6212d97279ca23db85c75 (patch) | |
| tree | ee6b107544b7a00bb159e9d804600df3410c1b72 /libcxxabi | |
| parent | 0c1c49f0ff8003aee22c3f26fca03c2f5385f355 (diff) | |
[libc++abi][ItaniumDemangle] Demangle DF16b as std::bfloat16_t (#120109)
This mangling is official in the Itanium C++ ABI specification and is
already supported by clang.
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/src/demangle/ItaniumDemangle.h | 5 | ||||
| -rw-r--r-- | libcxxabi/test/test_demangle.pass.cpp | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h index e4752bed6da8..3df41b5f4d7d 100644 --- a/libcxxabi/src/demangle/ItaniumDemangle.h +++ b/libcxxabi/src/demangle/ItaniumDemangle.h @@ -4330,9 +4330,12 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() { case 'h': First += 2; return make<NameType>("half"); - // ::= DF <number> _ # ISO/IEC TS 18661 binary floating point (N bits) + // ::= DF16b # C++23 std::bfloat16_t + // ::= DF <number> _ # ISO/IEC TS 18661 binary floating point (N bits) case 'F': { First += 2; + if (consumeIf("16b")) + return make<NameType>("std::bfloat16_t"); Node *DimensionNumber = make<NameType>(parseNumber()); if (!DimensionNumber) return nullptr; diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp index 67b9df212ff3..e9c74f70a094 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -33,7 +33,7 @@ // Is long double fp128? #define LDBL_FP128 (__LDBL_MANT_DIG__ == 113) -const char *cases[][2] = { +const char* cases[][2] = { // clang-format off {"_Z1A", "A"}, {"_Z1Av", "A()"}, @@ -30245,6 +30245,8 @@ const char *cases[][2] = { {"_Z1fDSDRj", "f(_Sat unsigned _Fract)"}, {"_Z1fDSDRl", "f(_Sat long _Fract)"}, {"_Z1fDSDRm", "f(_Sat unsigned long _Fract)"}, + + {"_Z11bfloat16addDF16bDF16b", "bfloat16add(std::bfloat16_t, std::bfloat16_t)"}, // clang-format on }; |
