From eb64b6a922cb9531db91ebc361281823653ade2f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 Nov 2003 00:09:17 +0000 Subject: [PATCH] output foo(void) as appropriate llvm-svn: 10232 --- llvm/lib/CWriter/Writer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index b3b5b40e242b..eeb2bdd4f3b5 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -941,6 +941,8 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { if (FT->isVarArg() && !FT->getParamTypes().empty()) { if (FT->getParamTypes().size()) FunctionInnards << ", "; FunctionInnards << "..."; // Output varargs portion of signature! + } else if (!FT->isVarArg() && FT->getParamTypes().empty()) { + FunctionInnards << "void"; // ret() -> ret(void) in C. } FunctionInnards << ")"; // Print out the return type and the entire signature for that matter