Fix a mangling bug where functions with no arguments weren't getting the 'v' parameter specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68162 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 7a7a480..427cc76 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -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)