r206247 - AST: Elaborated type specifier mangling occurs before nested-name

David Majnemer david.majnemer at gmail.com
Mon Apr 14 22:51:25 PDT 2014


Author: majnemer
Date: Tue Apr 15 00:51:25 2014
New Revision: 206247

URL: http://llvm.org/viewvc/llvm-project?rev=206247&view=rev
Log:
AST: Elaborated type specifier mangling occurs before nested-name

The Ts/Tu/Te manglings should occur before the nested-name's N.

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=206247&r1=206246&r2=206247&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Tue Apr 15 00:51:25 2014
@@ -2359,8 +2359,6 @@ void CXXNameMangler::mangleType(const Te
 }
 
 void CXXNameMangler::mangleType(const DependentNameType *T) {
-  // Typename types are always nested
-  Out << 'N';
   // Proposal by cxx-abi-dev, 2014-03-26
   // <class-enum-type> ::= <name>    # non-dependent or dependent type name or
   //                                 # dependent elaborated type specifier using
@@ -2388,6 +2386,8 @@ void CXXNameMangler::mangleType(const De
     default:
       llvm_unreachable("unexpected keyword for dependent type name");
   }
+  // Typename types are always nested
+  Out << 'N';
   manglePrefix(T->getQualifier());
   mangleSourceName(T->getIdentifier());
   Out << 'E';

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=206247&r1=206246&r2=206247&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Apr 15 00:51:25 2014
@@ -959,7 +959,7 @@ namespace test45 {
   template <typename T>
   void f(enum T::e *) {}
   template void f<S>(S::e *);
-  // CHECK-LABEL: define weak_odr void @_ZN6test451fINS_1SEEEvPNTeT_1eE(i32*)
+  // CHECK-LABEL: define weak_odr void @_ZN6test451fINS_1SEEEvPTeNT_1eE(i32*)
 }
 
 namespace test46 {
@@ -969,7 +969,7 @@ namespace test46 {
   template <typename T>
   void f(struct T::s *) {}
   template void f<S>(S::s *);
-  // CHECK-LABEL: define weak_odr void @_ZN6test461fINS_1SEEEvPNTsT_1sE(%"struct.test46::S::s"*)
+  // CHECK-LABEL: define weak_odr void @_ZN6test461fINS_1SEEEvPTsNT_1sE(%"struct.test46::S::s"*)
 }
 
 namespace test47 {
@@ -979,7 +979,7 @@ namespace test47 {
   template <typename T>
   void f(class T::c *) {}
   template void f<S>(S::c *);
-  // CHECK-LABEL: define weak_odr void @_ZN6test471fINS_1SEEEvPNTsT_1cE(%"class.test47::S::c"*)
+  // CHECK-LABEL: define weak_odr void @_ZN6test471fINS_1SEEEvPTsNT_1cE(%"class.test47::S::c"*)
 }
 
 namespace test48 {
@@ -989,5 +989,5 @@ namespace test48 {
   template <typename T>
   void f(union T::u *) {}
   template void f<S>(S::u *);
-  // CHECK-LABEL: define weak_odr void @_ZN6test481fINS_1SEEEvPNTuT_1uE(%"union.test48::S::u"*)
+  // CHECK-LABEL: define weak_odr void @_ZN6test481fINS_1SEEEvPTuNT_1uE(%"union.test48::S::u"*)
 }





More information about the cfe-commits mailing list