File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2719,19 +2719,29 @@ let trans_visitor
2719
2719
if Array. length ttup <> 0
2720
2720
then
2721
2721
begin
2722
+ let pc0 = (emitter() ).Il. emit_pc in
2722
2723
(iflog (fun _ ->
2723
2724
annotate (Printf. sprintf " tag case #%i" i)));
2724
2725
let jmps =
2725
2726
trans_compare_simple Il. JNE
2726
2727
(Il. Cell tmp) (imm (Int64. of_int i))
2727
2728
in
2728
2729
let ttup = get_nth_tag_tup cx ttag i in
2730
+ let pc1 = (emitter() ).Il. emit_pc in
2729
2731
iter_tup_parts
2730
2732
(get_element_ptr_dyn ty_params)
2731
2733
(get_variant_ptr dst_union i)
2732
2734
(get_variant_ptr src_union i)
2733
2735
ttup f;
2734
- List. iter patch jmps
2736
+
2737
+ (* Hack: if this variant is all dead code, blank it out. *)
2738
+ if pc1 = (emitter() ).Il. emit_pc
2739
+ then
2740
+ begin
2741
+ for j = pc0 to (pc1-1 )
2742
+ do (emitter() ).Il. emit_quads.(j) < - Il. deadq done
2743
+ end ;
2744
+ List. iter patch jmps;
2735
2745
end
2736
2746
done ;
2737
2747
You can’t perform that action at this time.
0 commit comments