[cfe-commits] r91136 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle.cpp

Eli Friedman eli.friedman at gmail.com
Fri Dec 11 10:00:58 PST 2009


Author: efriedma
Date: Fri Dec 11 12:00:57 2009
New Revision: 91136

URL: http://llvm.org/viewvc/llvm-project?rev=91136&view=rev
Log:
Fix for PR5706: let mangleName deal with mangling names without identifiers
correctly.


Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=91136&r1=91135&r2=91136&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Fri Dec 11 12:00:57 2009
@@ -877,10 +877,7 @@
   mangleType(static_cast<const TagType*>(T));
 }
 void CXXNameMangler::mangleType(const TagType *T) {
-  if (!T->getDecl()->getIdentifier())
-    mangleName(T->getDecl()->getTypedefForAnonDecl());
-  else
-    mangleName(T->getDecl());
+  mangleName(T->getDecl());
 }
 
 // <type>       ::= <array-type>

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=91136&r1=91135&r2=91136&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Fri Dec 11 12:00:57 2009
@@ -228,3 +228,11 @@
 template void ft8<int>();
 // CHECK: @_Z3ft8IPvEN11__enable_ifIXsr11__is_scalarIT_E7__valueEvE6__typeEv
 template void ft8<void*>();
+
+// PR5706
+// This example was crashing in the mangler code
+struct S8 {
+  virtual ~S8() { }
+};
+
+static struct : S8 { } obj8;





More information about the cfe-commits mailing list