[cfe-commits] r168862 - in /cfe/trunk: lib/AST/MicrosoftMangle.cpp test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
Timur Iskhodzhanov
timurrrr at google.com
Thu Nov 29 00:58:47 PST 2012
Author: timurrrr
Date: Thu Nov 29 02:58:47 2012
New Revision: 168862
URL: http://llvm.org/viewvc/llvm-project?rev=168862&view=rev
Log:
[-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=168862&r1=168861&r2=168862&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Thu Nov 29 02:58:47 2012
@@ -742,13 +742,17 @@
// Always start with the unqualified name.
// Templates have their own context for back references.
- BackRefMap TemplateContext;
- NameBackReferences.swap(TemplateContext);
+ ArgBackRefMap OuterArgsContext;
+ BackRefMap OuterTemplateContext;
+ NameBackReferences.swap(OuterTemplateContext);
+ TypeBackReferences.swap(OuterArgsContext);
mangleUnscopedTemplateName(TD);
mangleTemplateArgs(TemplateArgs);
- NameBackReferences.swap(TemplateContext);
+ // Restore the previous back reference contexts.
+ NameBackReferences.swap(OuterTemplateContext);
+ TypeBackReferences.swap(OuterArgsContext);
}
void
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp?rev=168862&r1=168861&r2=168862&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp Thu Nov 29 02:58:47 2012
@@ -13,6 +13,8 @@
// CHECK: "\01?foo_abb@@YAXV?$A at DV?$B at D@@V1@@@@Z"
void foo_abc(A<char, B<char>, C<char> >) {}
// CHECK: "\01?foo_abc@@YAXV?$A at DV?$B at D@@V?$C at D@@@@@Z"
+void foo_bt(bool a, B<bool(bool)> b) {}
+// CHECK: "\01?foo_bt@@YAX_NV?$B@$$A6A_N_N at Z@@@Z"
namespace N {
template<class X, class Y, class Z>
More information about the cfe-commits
mailing list