diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index dd5f0b1eb52..3003a02064b 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -567,8 +567,10 @@ void CWriter::printFunction(Function *F) { void CWriter::visitReturnInst(ReturnInst *I) { // Don't output a void return if this is the last basic block in the function if (I->getNumOperands() == 0 && - *(I->getParent()->getParent()->end()-1) == I->getParent()) + *(I->getParent()->getParent()->end()-1) == I->getParent() && + !I->getParent()->size() == 1) { return; + } Out << " return"; if (I->getNumOperands()) { |

