diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index 8b253bf67bcf..f2ad6899735e 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -2170,6 +2170,8 @@ Name *Demangler::demangleAnonymousNamespaceName(StringView &MangledName) { Error = true; return nullptr; } + StringView NamespaceKey = MangledName.substr(0, EndPos); + memorizeString(NamespaceKey); MangledName = MangledName.substr(EndPos + 1); return Node; } diff --git a/llvm/test/Demangle/ms-back-references.test b/llvm/test/Demangle/ms-back-references.test index b9ce7c21520b..53bc8b449ed9 100644 --- a/llvm/test/Demangle/ms-back-references.test +++ b/llvm/test/Demangle/ms-back-references.test @@ -166,3 +166,6 @@ ??$fun_tmpl_recurse@H$1?ident@fn_space@@YA?AURetVal@2@H@Z@fn_space@@YA?AURetVal@0@H@Z ; CHECK: struct fn_space::RetVal __cdecl fn_space::fun_tmpl_recurse(int) + +?AddEmitPasses@EmitAssemblyHelper@?A0x43583946@@AEAA_NAEAVPassManager@legacy@llvm@@W4BackendAction@clang@@AEAVraw_pwrite_stream@5@PEAV85@@Z +; CHECK: bool __cdecl `anonymous namespace'::EmitAssemblyHelper::AddEmitPasses(class llvm::legacy::PassManager &, enum clang::BackendAction, class llvm::raw_pwrite_stream &, class llvm::raw_pwrite_stream *)