Fix some fragile code wrt CFG edge updating.
[oota-llvm.git] / lib / CodeGen / MachineModuleInfo.cpp
index 32d8394527a1ae7d3447e03181108ee0c1248d7f..6ac038a1d9efed88976d07e9a4caf88d38864de8 100644 (file)
@@ -1728,6 +1728,10 @@ void MachineModuleInfo::TidyLandingPads() {
     LandingPadInfo &LandingPad = LandingPads[i];
     LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
 
+    if (!LandingPad.LandingPadBlock)
+      // Must not have cleanups if no landing pad.
+      LandingPad.TypeIds.clear();
+
     // Special case: we *should* emit LPs with null LP MBB. This indicates
     // "rethrow" case.
     if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {