diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-20 22:32:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-20 22:32:30 +0000 |
commit | 1f8c4a17c1c1ea488eaa2bbd736e3ac9dae96c10 (patch) | |
tree | dbb5b2583603a3e0f5426f56313824ef2a7797e9 /lib | |
parent | 61e4391b57a20213c7ee269591d34bb99c4efdea (diff) | |
download | external_llvm-1f8c4a17c1c1ea488eaa2bbd736e3ac9dae96c10.zip external_llvm-1f8c4a17c1c1ea488eaa2bbd736e3ac9dae96c10.tar.gz external_llvm-1f8c4a17c1c1ea488eaa2bbd736e3ac9dae96c10.tar.bz2 |
Fix bug: 2002-09-20-VarArgPrototypes.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 6 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 7501a9b..e993b74 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -683,8 +683,10 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { } } - // Finish printing arguments... - if (FT->isVarArg()) { + // Finish printing arguments... if this is a vararg function, print the ..., + // unless there are no known types, in which case, we just emit (). + // + if (FT->isVarArg() && !FT->getParamTypes().empty()) { if (FT->getParamTypes().size()) Out << ", "; Out << "..."; // Output varargs portion of signature! } diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 7501a9b..e993b74 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -683,8 +683,10 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { } } - // Finish printing arguments... - if (FT->isVarArg()) { + // Finish printing arguments... if this is a vararg function, print the ..., + // unless there are no known types, in which case, we just emit (). + // + if (FT->isVarArg() && !FT->getParamTypes().empty()) { if (FT->getParamTypes().size()) Out << ", "; Out << "..."; // Output varargs portion of signature! } |