[cfe-commits] r68162 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle.cpp
Anders Carlsson
andersca at mac.com
Tue Mar 31 17:15:23 PDT 2009
Author: andersca
Date: Tue Mar 31 19:15:23 2009
New Revision: 68162
URL: http://llvm.org/viewvc/llvm-project?rev=68162&view=rev
Log:
Fix a mangling bug where functions with no arguments weren't getting the 'v' parameter specifier.
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=68162&r1=68161&r2=68162&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Mar 31 19:15:23 2009
@@ -477,6 +477,11 @@
const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(T);
assert(Proto && "Can't mangle K&R function prototypes");
+ if (Proto->getNumArgs() == 0) {
+ Out << 'v';
+ return;
+ }
+
for (FunctionProtoType::arg_type_iterator Arg = Proto->arg_type_begin(),
ArgEnd = Proto->arg_type_end();
Arg != ArgEnd; ++Arg)
Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=68162&r1=68161&r2=68162&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Mar 31 19:15:23 2009
@@ -24,3 +24,5 @@
typedef struct { int a; } x,y;
void f(y) { }
+// RUN: grep _Z1fv %t | count 1
+void f() { }
More information about the cfe-commits
mailing list