summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CWriter/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-13 20:15:37 +0000
committerChris Lattner <sabre@nondot.org>2003-05-13 20:15:37 +0000
commit922f4f2bd4576e82440f00cda8a6b909247a4096 (patch)
tree1ed559e45c4dd105e9d59626a9c2a89ba044e516 /llvm/lib/CWriter/Writer.cpp
parentc50e3700ade24803dbce040509d86f261db0a866 (diff)
downloadbcm5719-llvm-922f4f2bd4576e82440f00cda8a6b909247a4096.tar.gz
bcm5719-llvm-922f4f2bd4576e82440f00cda8a6b909247a4096.zip
Fix bug: CBackend/2003-05-13-VarArgFunction.ll
In C, a prototype with no arguments is varargs. A prototype that takes void has zero args. llvm-svn: 6172
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
-rw-r--r--llvm/lib/CWriter/Writer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp
index 3ab03e988e6..195a4f71ec6 100644
--- a/llvm/lib/CWriter/Writer.cpp
+++ b/llvm/lib/CWriter/Writer.cpp
@@ -218,8 +218,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
}
if (MTy->isVarArg()) {
if (!MTy->getParamTypes().empty())
- FunctionInards << ", ";
- FunctionInards << "...";
+ FunctionInards << ", ...";
+ } else if (MTy->getParamTypes().empty()) {
+ FunctionInards << "void";
}
FunctionInards << ")";
std::string tstr = FunctionInards.str();
OpenPOWER on IntegriCloud