diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 790433e8b4e..4b00d01cee9 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -966,7 +966,7 @@ struct LandingPadInfo { : LandingPadBlock(MBB) , LandingPadLabel(0) , Personality(NULL) - , TypeIds() + , TypeIds(1, 0) // Always have cleanups {} }; diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 32d8394527a..6ac038a1d9e 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -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) {