Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-05-21 18:05:19 +00:00
parent 94c75eccf1
commit 963b70bbf8
2 changed files with 6 additions and 2 deletions

View File

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

View File

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