Implement demangling for user-defined operators.
authorHoward Hinnant <hhinnant@apple.com>
Mon, 6 Jan 2014 23:05:04 +0000 (23:05 +0000)
committerHoward Hinnant <hhinnant@apple.com>
Mon, 6 Jan 2014 23:05:04 +0000 (23:05 +0000)
llvm-svn: 198643

libcxxabi/src/cxa_demangle.cpp
libcxxabi/test/test_demangle.cpp

index ca4155d..839aebe 100644 (file)
@@ -2277,6 +2277,7 @@ parse_type(const char* first, const char* last, C& db)
 //                   ::= gt    # >             
 //                   ::= ix    # []            
 //                   ::= le    # <=            
+//                   ::= li <source-name>  # operator ""
 //                   ::= ls    # <<            
 //                   ::= lS    # <<=           
 //                   ::= lt    # <             
@@ -2438,6 +2439,18 @@ parse_operator_name(const char* first, const char* last, C& db)
                 db.names.push_back("operator<=");
                 first += 2;
                 break;
+            case 'i':
+                {
+                    const char* t = parse_source_name(first+2, last, db);
+                    if (t != first+2)
+                    {
+                        if (db.names.empty())
+                            return first;
+                        db.names.back().first.insert(0, "operator\"\" ");
+                        first = t;
+                    }
+                }
+                break;
             case 's':
                 db.names.push_back("operator<<");
                 first += 2;
index 9bff745..2d9dd55 100644 (file)
@@ -29584,6 +29584,7 @@ const char* cases[][2] =
     {"_Z1fPKU11objcproto1A7NSArray", "f(NSArray<A> const*)"},
     {"_ZNK1AIJ1Z1Y1XEEcv1BIJDpPT_EEIJS2_S1_S0_EEEv", "A<Z, Y, X>::operator B<X*, Y*, Z*><X, Y, Z>() const"},
     {"_ZNK3Ncr6Silver7Utility6detail12CallOnThreadIZ53-[DeploymentSetupController handleManualServerEntry:]E3$_5EclIJEEEDTclclL_ZNS2_4getTIS4_EERT_vEEspclsr3stdE7forwardIT_Efp_EEEDpOSA_", "decltype(-[DeploymentSetupController handleManualServerEntry:]::$_5& Ncr::Silver::Utility::detail::getT<-[DeploymentSetupController handleManualServerEntry:]::$_5>()()(std::forward<-[DeploymentSetupController handleManualServerEntry:]::$_5>(fp))) Ncr::Silver::Utility::detail::CallOnThread<-[DeploymentSetupController handleManualServerEntry:]::$_5>::operator()<>(-[DeploymentSetupController handleManualServerEntry:]::$_5&&) const"},
+    {"_Zli2_xy", "operator\"\" _x(unsigned long long)"},
 };
 
 const unsigned N = sizeof(cases) / sizeof(cases[0]);