[llvm] r340237 - [MS Demangler] Properly demangle anonymous namespaces.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 20 16:58:36 PDT 2018
Author: zturner
Date: Mon Aug 20 16:58:35 2018
New Revision: 340237
URL: http://llvm.org/viewvc/llvm-project?rev=340237&view=rev
Log:
[MS Demangler] Properly demangle anonymous namespaces.
Modified:
llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
llvm/trunk/test/Demangle/ms-basic.test
Modified: llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp?rev=340237&r1=340236&r2=340237&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp Mon Aug 20 16:58:35 2018
@@ -2165,11 +2165,13 @@ Name *Demangler::demangleAnonymousNamesp
Name *Node = Arena.alloc<Name>();
Node->Str = "`anonymous namespace'";
- if (MangledName.consumeFront('@'))
- return Node;
-
- Error = true;
- return nullptr;
+ size_t EndPos = MangledName.find('@');
+ if (EndPos == StringView::npos) {
+ Error = true;
+ return nullptr;
+ }
+ MangledName = MangledName.substr(EndPos + 1);
+ return Node;
}
Name *Demangler::demangleLocallyScopedNamePiece(StringView &MangledName) {
Modified: llvm/trunk/test/Demangle/ms-basic.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Demangle/ms-basic.test?rev=340237&r1=340236&r2=340237&view=diff
==============================================================================
--- llvm/trunk/test/Demangle/ms-basic.test (original)
+++ llvm/trunk/test/Demangle/ms-basic.test Mon Aug 20 16:58:35 2018
@@ -228,3 +228,5 @@
??_V at YAXPEAXAEAVklass@@@Z
; CHECK: void __cdecl operator delete[](void *, class klass &)
+; ?A@?A0x43583946@@3VB@@B
+class B const `anonymous namespace'::A
\ No newline at end of file
More information about the llvm-commits
mailing list