From cccfd194ecf8e1c6fb203ec3f96aca8cfe9e0484 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 21 Sep 2011 22:57:02 +0000 Subject: [PATCH] The last verification check for the new EH model. This makes sure that the unwind destination of an invoke is a landing pad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140280 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 7635998a592..5936d809835 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1167,6 +1167,12 @@ void Verifier::visitCallInst(CallInst &CI) { void Verifier::visitInvokeInst(InvokeInst &II) { VerifyCallSite(&II); + + // Verify that there is a landingpad instruction as the first non-PHI + // instruction of the 'unwind' destination. + Assert1(II.getUnwindDest()->isLandingPad(), + "The unwind destination does not have a landingpad instruction!",&II); + visitTerminatorInst(II); } -- 2.34.1