aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index 399fb0d82c..33872fa110 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -1669,8 +1669,8 @@ LandingPadInfo &MachineModuleInfo::getOrCreateLandingPadInfo
void MachineModuleInfo::addInvoke(MachineBasicBlock *LandingPad,
unsigned BeginLabel, unsigned EndLabel) {
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
- if (!LP.BeginLabel) LP.BeginLabel = BeginLabel;
- LP.EndLabel = EndLabel;
+ LP.BeginLabels.push_back(BeginLabel);
+ LP.EndLabels.push_back(EndLabel);
}
/// addLandingPad - Provide the label of a try LandingPad block.
@@ -1711,16 +1711,29 @@ void MachineModuleInfo::setIsFilterLandingPad(MachineBasicBlock *LandingPad) {
void MachineModuleInfo::TidyLandingPads() {
for (unsigned i = 0; i != LandingPads.size(); ) {
LandingPadInfo &LandingPad = LandingPads[i];
- LandingPad.BeginLabel = MappedLabel(LandingPad.BeginLabel);
- LandingPad.EndLabel = MappedLabel(LandingPad.EndLabel);
LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
-
- if (!LandingPad.BeginLabel ||
- !LandingPad.EndLabel ||
- !LandingPad.LandingPadLabel) {
+
+ if (!LandingPad.LandingPadLabel) {
LandingPads.erase(LandingPads.begin() + i);
continue;
}
+
+ for (unsigned j=0; j != LandingPads[i].BeginLabels.size(); ) {
+ unsigned BeginLabel = MappedLabel(LandingPad.BeginLabels[j]);
+ unsigned EndLabel = MappedLabel(LandingPad.EndLabels[j]);
+
+
+ if (!BeginLabel || !EndLabel) {
+ printf("Tidy: %d, %d, %d\n", BeginLabel, EndLabel, LandingPad.LandingPadLabel);
+ LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
+ LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
+ continue;
+ }
+
+ LandingPad.BeginLabels[j] = BeginLabel;
+ LandingPad.EndLabels[j] = EndLabel;
+ ++j;
+ }
++i;
}