diff options
author | Pengfei Wang <pengfei.wang@intel.com> | 2021-09-23 06:02:25 +0300 |
---|---|---|
committer | Wang, Pengfei <pengfei.wang@intel.com> | 2021-09-23 06:02:58 +0300 |
commit | 1873f3be78a5255df8c36c195f4c778f9f47fc5c (patch) | |
tree | 74bf1dd318557979b7ce3ef73d225829a4c417f6 /libcxxabi/src/demangle | |
parent | ebec077e07f5d35a870f075fb665c006978d49ea (diff) |
[demangle] Support for ISO/IEC TS 18661 binary floating point type
Reviewed By: #libc_abi, ldionne
Differential Revision: https://reviews.llvm.org/D105278
Diffstat (limited to 'libcxxabi/src/demangle')
-rw-r--r-- | libcxxabi/src/demangle/ItaniumDemangle.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h index f73959868d70..c581ed727476 100644 --- a/libcxxabi/src/demangle/ItaniumDemangle.h +++ b/libcxxabi/src/demangle/ItaniumDemangle.h @@ -57,6 +57,7 @@ X(LocalName) \ X(VectorType) \ X(PixelVectorType) \ + X(BinaryFPType) \ X(SyntheticTemplateParamName) \ X(TypeTemplateParamDecl) \ X(NonTypeTemplateParamDecl) \ @@ -1074,6 +1075,21 @@ public: } }; +class BinaryFPType final : public Node { + const Node *Dimension; + +public: + BinaryFPType(const Node *Dimension_) + : Node(KBinaryFPType), Dimension(Dimension_) {} + + template<typename Fn> void match(Fn F) const { F(Dimension); } + + void printLeft(OutputStream &S) const override { + S += "_Float"; + Dimension->print(S); + } +}; + enum class TemplateParamKind { Type, NonType, Template }; /// An invented name for a template parameter for which we don't have a @@ -3904,6 +3920,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() { case 'h': First += 2; return make<NameType>("half"); + // ::= DF <number> _ # ISO/IEC TS 18661 binary floating point (N bits) + case 'F': { + First += 2; + Node *DimensionNumber = make<NameType>(parseNumber()); + if (!DimensionNumber) + return nullptr; + if (!consumeIf('_')) + return nullptr; + return make<BinaryFPType>(DimensionNumber); + } // ::= Di # char32_t case 'i': First += 2; |