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

Anders Carlsson andersca at mac.com
Tue Jun 1 21:40:13 PDT 2010


Author: andersca
Date: Tue Jun  1 23:40:13 2010
New Revision: 105311

URL: http://llvm.org/viewvc/llvm-project?rev=105311&view=rev
Log:
Correctly mangle variadic functions that don't have any other parameters.

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=105311&r1=105310&r2=105311&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Jun  1 23:40:13 2010
@@ -1143,7 +1143,8 @@
   if (MangleReturnType)
     mangleType(Proto->getResultType());
 
-  if (Proto->getNumArgs() == 0) {
+  if (Proto->getNumArgs() == 0 && !Proto->isVariadic()) {
+    //   <builtin-type> ::= v	# void
     Out << 'v';
     return;
   }

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=105311&r1=105310&r2=105311&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Jun  1 23:40:13 2010
@@ -477,3 +477,15 @@
   // CHECK: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE(
   template void f<(char) 3>(struct S<3>);
 }
+
+namespace test11 {
+  // CHECK: @_ZN6test111fEz
+  void f(...) { }
+
+  struct A {
+    void f(...);
+  };
+  
+  // CHECK: @_ZN6test111A1fEz
+  void A::f(...) { }
+}





More information about the cfe-commits mailing list