mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
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:
parent
f3b467c243
commit
ddfc03c8cb
@ -218,8 +218,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
|
|||||||
}
|
}
|
||||||
if (MTy->isVarArg()) {
|
if (MTy->isVarArg()) {
|
||||||
if (!MTy->getParamTypes().empty())
|
if (!MTy->getParamTypes().empty())
|
||||||
FunctionInards << ", ";
|
FunctionInards << ", ...";
|
||||||
FunctionInards << "...";
|
} else if (MTy->getParamTypes().empty()) {
|
||||||
|
FunctionInards << "void";
|
||||||
}
|
}
|
||||||
FunctionInards << ")";
|
FunctionInards << ")";
|
||||||
std::string tstr = FunctionInards.str();
|
std::string tstr = FunctionInards.str();
|
||||||
|
@ -218,8 +218,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
|
|||||||
}
|
}
|
||||||
if (MTy->isVarArg()) {
|
if (MTy->isVarArg()) {
|
||||||
if (!MTy->getParamTypes().empty())
|
if (!MTy->getParamTypes().empty())
|
||||||
FunctionInards << ", ";
|
FunctionInards << ", ...";
|
||||||
FunctionInards << "...";
|
} else if (MTy->getParamTypes().empty()) {
|
||||||
|
FunctionInards << "void";
|
||||||
}
|
}
|
||||||
FunctionInards << ")";
|
FunctionInards << ")";
|
||||||
std::string tstr = FunctionInards.str();
|
std::string tstr = FunctionInards.str();
|
||||||
|
Loading…
Reference in New Issue
Block a user