[libcxx-commits] [PATCH] D123305: [demangler] Fold expressions of .* and ->*

Nathan Sidwell via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 3 06:46:28 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGed2d4da73200: [demangler] Fold expressions of .* and ->* (authored by urnathan).
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++abi.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123305/new/

https://reviews.llvm.org/D123305

Files:
  libcxxabi/src/demangle/ItaniumDemangle.h
  libcxxabi/test/test_demangle.pass.cpp
  llvm/include/llvm/Demangle/ItaniumDemangle.h


Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -4447,7 +4447,11 @@
   ++First;
 
   const auto *Op = parseOperatorEncoding();
-  if (!Op || Op->getKind() != OperatorInfo::Binary)
+  if (!Op)
+    return nullptr;
+  if (!(Op->getKind() == OperatorInfo::Binary
+        || (Op->getKind() == OperatorInfo::Member
+            && Op->getName().back() == '*')))
     return nullptr;
 
   Node *Pack = getDerived().parseExpr();
Index: libcxxabi/test/test_demangle.pass.cpp
===================================================================
--- libcxxabi/test/test_demangle.pass.cpp
+++ libcxxabi/test/test_demangle.pass.cpp
@@ -29963,6 +29963,8 @@
      "void Partial<1, 2>::foldr<3, 4>(A<1 + (2 + ((3, 4) + ... + (1 + (2 + ((3, 4) + ...)))))>)"},
     {"_ZN7PartialIJLi1ELi2EEE5foldrIJLi3ELi4EEEEv1AIXplplLi1ELi2EfRplT_plplLi1ELi2EflplT_EE",
      "void Partial<1, 2>::foldr<3, 4>(A<1 + 2 + ((3, 4) + ... + (1 + 2 + (... + (3, 4))))>)"},
+    {"_Z1fIXfLpm1x1yEEvv", "void f<(x ->* ... ->* (y...))>()"},
+    {"_Z1fIXfLds1x1yEEvv", "void f<(x .* ... .* (y...))>()"},
 
     // reference collapsing:
     {"_Z1fIR1SEiOT_", "int f<S&>(S&)"},
@@ -30173,6 +30175,9 @@
     "_ZN1fIiEEvNTUt_E",
     "_ZNDTUt_Ev",
 
+    "_Z1fIXfLpt1x1yEEvv",
+    "_Z1fIXfLdt1x1yEEvv",
+
     "_ZN1fIXawLi0EEEEvv",
 
     "_ZNWUt_3FOOEv",
Index: libcxxabi/src/demangle/ItaniumDemangle.h
===================================================================
--- libcxxabi/src/demangle/ItaniumDemangle.h
+++ libcxxabi/src/demangle/ItaniumDemangle.h
@@ -4447,7 +4447,11 @@
   ++First;
 
   const auto *Op = parseOperatorEncoding();
-  if (!Op || Op->getKind() != OperatorInfo::Binary)
+  if (!Op)
+    return nullptr;
+  if (!(Op->getKind() == OperatorInfo::Binary
+        || (Op->getKind() == OperatorInfo::Member
+            && Op->getName().back() == '*')))
     return nullptr;
 
   Node *Pack = getDerived().parseExpr();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123305.426685.patch
Type: text/x-patch
Size: 2070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220503/3889d801/attachment.bin>


More information about the libcxx-commits mailing list