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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-05-13 20:15:37 +00:00
parent f3b467c243
commit ddfc03c8cb
2 changed files with 6 additions and 4 deletions

View File

@ -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();

View File

@ -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();