[cfe-commits] r157959 - in /cfe/trunk: lib/AST/MicrosoftMangle.cpp test/CodeGenCXX/mangle-ms.cpp

Richard Smith richard-llvm at metafoo.co.uk
Mon Jun 4 15:46:59 PDT 2012


Author: rsmith
Date: Mon Jun  4 17:46:59 2012
New Revision: 157959

URL: http://llvm.org/viewvc/llvm-project?rev=157959&view=rev
Log:
PR13022: cope with parenthesized function types in MS name mangling.

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=157959&r1=157958&r2=157959&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Mon Jun  4 17:46:59 2012
@@ -198,7 +198,7 @@
   
   // We should never ever see a FunctionNoProtoType at this point.
   // We don't even know how to mangle their types anyway :).
-  const FunctionProtoType *FT = cast<FunctionProtoType>(FD->getType());
+  const FunctionProtoType *FT = FD->getType()->castAs<FunctionProtoType>();
 
   bool InStructor = false, InInstMethod = false;
   const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD);

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms.cpp?rev=157959&r1=157958&r2=157959&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms.cpp Mon Jun  4 17:46:59 2012
@@ -116,3 +116,8 @@
   delete [] array;
 // CHECK: @"\01??_V at YAXPAX@Z"
 }
+
+// PR13022
+void (redundant_parens)();
+void redundant_parens_use() { redundant_parens(); }
+// CHECK: @"\01?redundant_parens@@YAXXZ"





More information about the cfe-commits mailing list