[PATCH] D15841: [WinEH] Tighten parentPad verifier checks

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 1 23:20:31 PST 2016


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/IR/Verifier.cpp:3022-3023
@@ -3021,4 +3021,4 @@
   auto *ParentPad = CPI.getParentPad();
-  Assert(isa<CatchSwitchInst>(ParentPad) || isa<ConstantTokenNone>(ParentPad) ||
-             isa<CleanupPadInst>(ParentPad) || isa<CatchPadInst>(ParentPad),
+  Assert(isa<ConstantTokenNone>(ParentPad) || isa<CleanupPadInst>(ParentPad) ||
+             isa<CatchPadInst>(ParentPad),
          "CleanupPadInst has an invalid parent.", &CPI);
----------------
I guess we can simplify this by writing it as `isa<ConstantTokenNone>(ParentPad) || isa<FuncletEHPadInst>(ParentPad)`.

================
Comment at: lib/IR/Verifier.cpp:3080-3081
@@ -3079,4 +3079,4 @@
   auto *ParentPad = CatchSwitch.getParentPad();
-  Assert(isa<CatchSwitchInst>(ParentPad) || isa<ConstantTokenNone>(ParentPad) ||
-             isa<CleanupPadInst>(ParentPad) || isa<CatchPadInst>(ParentPad),
+  Assert(isa<ConstantTokenNone>(ParentPad) || isa<CleanupPadInst>(ParentPad) ||
+             isa<CatchPadInst>(ParentPad),
          "CatchSwitchInst has an invalid parent.", ParentPad);
----------------
Ditto.


http://reviews.llvm.org/D15841





More information about the llvm-commits mailing list