[cfe-commits] r168583 - in /cfe/trunk: lib/AST/MicrosoftMangle.cpp test/CodeGenCXX/mangle-ms.cpp
Timur Iskhodzhanov
timurrrr at google.com
Mon Nov 26 00:55:48 PST 2012
Author: timurrrr
Date: Mon Nov 26 02:55:48 2012
New Revision: 168583
URL: http://llvm.org/viewvc/llvm-project?rev=168583&view=rev
Log:
Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoft
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Mon Nov 26 02:55:48 2012
@@ -453,7 +453,7 @@
if (const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(ND)) {
if (NS->isAnonymousNamespace()) {
- Out << "?A";
+ Out << "?A@";
break;
}
}
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms.cpp?rev=168583&r1=168582&r2=168583&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms.cpp Mon Nov 26 02:55:48 2012
@@ -3,6 +3,7 @@
// CHECK: @"\01?a@@3HA"
// CHECK: @"\01?b at N@@3HA"
+// CHECK: @"\01?anonymous@?A at N@@3HA"
// CHECK: @c
// CHECK: @"\01?d at foo@@0FB"
// CHECK: @"\01?e at foo@@1JC"
@@ -24,10 +25,16 @@
int a;
-namespace N { int b; }
+namespace N {
+ int b;
+
+ namespace {
+ int anonymous;
+ }
+}
static int c;
-int _c(void) {return c;}
+int _c(void) {return N::anonymous + c;}
// CHECK: @"\01?_c@@YAHXZ"
class foo {
More information about the cfe-commits
mailing list