aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h2
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index 790433e8b4..4b00d01cee 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 32d8394527..6ac038a1d9 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) {