diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-08-28 19:56:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-08-28 19:56:10 +0000 |
| commit | cbd234f26b0e49441fd7794fa4bcc73eb401d6c0 (patch) | |
| tree | 16df7acc4a23f30dc291349f785a0c53519a230c | |
| parent | 190b7a86bac1b8157c6500facd82f01a17ec82fa (diff) | |
| download | bcm5719-llvm-cbd234f26b0e49441fd7794fa4bcc73eb401d6c0.tar.gz bcm5719-llvm-cbd234f26b0e49441fd7794fa4bcc73eb401d6c0.zip | |
Fix really nasty bugs in the CWriter, handling invoke instructions. Tracking
these down was NOT phun.
llvm-svn: 8181
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index a6220751415..721ead091c2 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -894,7 +894,8 @@ void CWriter::printFunction(Function *F) { UI != UE; ++UI) if (TerminatorInst *TI = dyn_cast<TerminatorInst>(*UI)) if (TI != Prev->getTerminator() || - isa<SwitchInst>(Prev->getTerminator())) { + isa<SwitchInst>(Prev->getTerminator()) || + isa<InvokeInst>(Prev->getTerminator())) { NeedsLabel = true; break; } @@ -968,6 +969,8 @@ void CWriter::visitInvokeInst(InvokeInst &II) { Out << " }\n" << " __llvm_jmpbuf_list = &Entry;\n" << " "; + + if (II.getType() != Type::VoidTy) outputLValue(&II); visitCallSite(&II); Out << ";\n" << " __llvm_jmpbuf_list = Entry.next;\n" @@ -998,7 +1001,7 @@ void CWriter::printBranchToBlock(BasicBlock *CurBB, BasicBlock *Succ, Out << "; /* for PHI node */\n"; } - if (CurBB->getNext() != Succ) { + if (CurBB->getNext() != Succ || isa<InvokeInst>(CurBB->getTerminator())) { Out << std::string(Indent, ' ') << " goto "; writeOperand(Succ); Out << ";\n"; |

