The last verification check for the new EH model.
[oota-llvm.git] / lib / VMCore / Verifier.cpp
index 7635998a5927d7b967b9b75c2477ed341eb72458..5936d80983561498aa265c3bd851ddee688fb51e 100644 (file)
@@ -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);
 }