OSDN Git Service

llvm-undname; Add more test coverage for demangleFunctionClass()
authorNico Weber <nicolasweber@gmx.de>
Sun, 2 Jun 2019 23:26:57 +0000 (23:26 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sun, 2 Jun 2019 23:26:57 +0000 (23:26 +0000)
Also add two FC_Far that seem to be missing, by symmetry from
the public and protected cases. (But FC_Far isn't really a thing
anymore, so this doesn't really have an observable effect.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362344 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Demangle/MicrosoftDemangle.cpp
test/Demangle/ms-mangle.test

index ed9052f..b93a84e 100644 (file)
@@ -1587,11 +1587,11 @@ FuncClass Demangler::demangleFunctionClass(StringView &MangledName) {
   case 'C':
     return FuncClass(FC_Private | FC_Static);
   case 'D':
-    return FuncClass(FC_Private | FC_Static);
+    return FuncClass(FC_Private | FC_Static | FC_Far);
   case 'E':
     return FuncClass(FC_Private | FC_Virtual);
   case 'F':
-    return FuncClass(FC_Private | FC_Virtual);
+    return FuncClass(FC_Private | FC_Virtual | FC_Far);
   case 'G':
     return FuncClass(FC_Private | FC_StaticThisAdjust);
   case 'H':
index e7badee..bbac3eb 100644 (file)
 
 ??$emplace_back@ABH@?$vector@HV?$allocator@H@std@@@std@@QAE?A?<decltype-auto>@@ABH@Z
 ; CHECK: <decltype-auto> __thiscall std::vector<int, class std::allocator<int>>::emplace_back<int const &>(int const &)
+
+
+?pub_foo@S@@QAEXXZ
+; CHECK: public: void __thiscall S::pub_foo(void)
+
+?pub_stat_foo@S@@SAXXZ
+; CHECK: public: static void __cdecl S::pub_stat_foo(void)
+
+?pub_virt_foo@S@@UAEXXZ
+; CHECK: public: virtual void __thiscall S::pub_virt_foo(void)
+
+?prot_foo@S@@IAEXXZ
+; CHECK: protected: void __thiscall S::prot_foo(void)
+
+?prot_stat_foo@S@@KAXXZ
+; CHECK: protected: static void __cdecl S::prot_stat_foo(void)
+
+?prot_virt_foo@S@@MAEXXZ
+; CHECK: protected: virtual void __thiscall S::prot_virt_foo(void)
+
+?priv_foo@S@@AAEXXZ
+; CHECK: private: void __thiscall S::priv_foo(void)
+
+?priv_stat_foo@S@@CAXXZ
+; CHECK: private: static void __cdecl S::priv_stat_foo(void)
+
+?priv_virt_foo@S@@EAEXXZ
+; CHECK: private: virtual void __thiscall S::priv_virt_foo(void)