[llvm] 91a848b - Revert "[Demangle] demangle builtin type transformations"

Congcong Cai via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 10 08:19:06 PDT 2023


Author: Congcong Cai
Date: 2023-09-10T23:18:43+08:00
New Revision: 91a848bc893e9d464bf8fe03f3f319eaff936d08

URL: https://github.com/llvm/llvm-project/commit/91a848bc893e9d464bf8fe03f3f319eaff936d08
DIFF: https://github.com/llvm/llvm-project/commit/91a848bc893e9d464bf8fe03f3f319eaff936d08.diff

LOG: Revert "[Demangle] demangle builtin type transformations"

This reverts commit 31cc069b5f4cb1b120c72f4dcbaa1b5a212120df.

Added: 
    

Modified: 
    libcxxabi/src/demangle/ItaniumDemangle.h
    libcxxabi/src/demangle/ItaniumNodes.def
    libcxxabi/test/test_demangle.pass.cpp
    llvm/include/llvm/Demangle/ItaniumDemangle.h
    llvm/include/llvm/Demangle/ItaniumNodes.def

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 1b4d30c84bb9c56..c80f343cc876e99 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -534,23 +534,6 @@ class ElaboratedTypeSpefType : public Node {
   }
 };
 
-class TransformedType : public Node {
-  StringView Transform;
-  Node *BaseType;
-public:
-  TransformedType(StringView Transform_, Node *BaseType_)
-      : Node(KTransformedType), Transform(Transform_), BaseType(BaseType_) {}
-
-  template<typename Fn> void match(Fn F) const { F(Transform, BaseType); }
-
-  void printLeft(OutputBuffer &OB) const override {
-    OB += Transform;
-    OB += '(';
-    BaseType->print(OB);
-    OB += ')';
-  }
-};
-
 struct AbiTagAttr : Node {
   Node *Base;
   std::string_view Tag;
@@ -3911,15 +3894,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
     // Typically, <builtin-type>s are not considered substitution candidates,
     // but the exception to that exception is vendor extended types (Itanium C++
     // ABI 5.9.1).
-    if (consumeIf('I')) {
-      Node *BaseType = parseType();
-      if (BaseType == nullptr)
-        return nullptr;
-      if (!consumeIf('E'))
-        return nullptr;
-      Result = make<TransformedType>(Res, BaseType);
-    } else
-      Result = make<NameType>(Res);
+    Result = make<NameType>(Res);
     break;
   }
   case 'D':

diff  --git a/libcxxabi/src/demangle/ItaniumNodes.def b/libcxxabi/src/demangle/ItaniumNodes.def
index a54ee370a935b7a..f615cb9fadb05e8 100644
--- a/libcxxabi/src/demangle/ItaniumNodes.def
+++ b/libcxxabi/src/demangle/ItaniumNodes.def
@@ -19,7 +19,6 @@ NODE(QualType)
 NODE(ConversionOperatorType)
 NODE(PostfixQualifiedType)
 NODE(ElaboratedTypeSpefType)
-NODE(TransformedType)
 NODE(NameType)
 NODE(AbiTagAttr)
 NODE(EnableIfAttr)

diff  --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp
index 891bc8b43d1bd47..471808db5d5b8fc 100644
--- a/libcxxabi/test/test_demangle.pass.cpp
+++ b/libcxxabi/test/test_demangle.pass.cpp
@@ -30114,9 +30114,6 @@ const char* cases[][2] =
      " std::allocator<char>>::basic_string()"},
     {"_ZN1SB8ctor_tagC2Ev", "S[abi:ctor_tag]::S()"},
     {"_ZN1SB8ctor_tagD2Ev", "S[abi:ctor_tag]::~S()"},
-
-    // clang builtin type transform
-    {"_Z2f5IiEvu7__decayIT_E", "void f5<int>(__decay(int))"},
 };
 
 const unsigned N = sizeof(cases) / sizeof(cases[0]);

diff  --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index e8d799e65df0d52..26acd38f8ae8476 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -528,23 +528,6 @@ class ElaboratedTypeSpefType : public Node {
   }
 };
 
-class TransformedType : public Node {
-  StringView Transform;
-  Node *BaseType;
-public:
-  TransformedType(StringView Transform_, Node *BaseType_)
-      : Node(KTransformedType), Transform(Transform_), BaseType(BaseType_) {}
-
-  template<typename Fn> void match(Fn F) const { F(Transform, BaseType); }
-
-  void printLeft(OutputBuffer &OB) const override {
-    OB += Transform;
-    OB += '(';
-    BaseType->print(OB);
-    OB += ')';
-  }
-};
-
 struct AbiTagAttr : Node {
   Node *Base;
   std::string_view Tag;
@@ -3906,15 +3889,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
     // Typically, <builtin-type>s are not considered substitution candidates,
     // but the exception to that exception is vendor extended types (Itanium C++
     // ABI 5.9.1).
-    if (consumeIf('I')) {
-      Node *BaseType = parseType();
-      if (BaseType == nullptr)
-        return nullptr;
-      if (!consumeIf('E'))
-        return nullptr;
-      Result = make<TransformedType>(Res, BaseType);
-    } else
-      Result = make<NameType>(Res);
+    Result = make<NameType>(Res);
     break;
   }
   case 'D':

diff  --git a/llvm/include/llvm/Demangle/ItaniumNodes.def b/llvm/include/llvm/Demangle/ItaniumNodes.def
index dafce502ce9e900..c0e277d554ccfad 100644
--- a/llvm/include/llvm/Demangle/ItaniumNodes.def
+++ b/llvm/include/llvm/Demangle/ItaniumNodes.def
@@ -19,7 +19,6 @@ NODE(QualType)
 NODE(ConversionOperatorType)
 NODE(PostfixQualifiedType)
 NODE(ElaboratedTypeSpefType)
-NODE(TransformedType)
 NODE(NameType)
 NODE(AbiTagAttr)
 NODE(EnableIfAttr)


        


More information about the llvm-commits mailing list