+ -- If the target of a switch, branch or cond branch becomes a proc point
+ -- then we have to make a new block what will then *jump* to the original target.
+ proc_point_fix unique (CmmCondBranch test target)
+ = (CmmCondBranch test new_target, new_blocks)
+ where (new_target, new_blocks) = block_for_branch (head unique) target
+ proc_point_fix unique (CmmSwitch test targets)
+ = (CmmSwitch test new_targets, concat new_blocks)
+ where (new_targets, new_blocks) =
+ unzip $ zipWith block_for_branch' unique targets
+ proc_point_fix unique (CmmBranch target)
+ = (CmmBranch new_target, new_blocks)
+ where (new_target, new_blocks) = block_for_branch (head unique) target
+ proc_point_fix _ other = (other, [])
+
+ (fixed_main_stmts, new_blocks) = unzip $ zipWith proc_point_fix new_block_uniques main_stmts
+ main_stmts =