Skip to content

Commit

Permalink
Use correct debuginfo values for Ialloc (ocaml-flambda#2481)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell authored Apr 24, 2024
1 parent f61db89 commit 8600190
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions backend/selectgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ method emit_expr_aux (env:environment) exp ~bound_name : Reg.t array option =
in
self#insert_debug env (Iop op) dbg [||] rd;
add_naming_op_for_bound_name rd;
self#emit_stores env new_args rd;
self#emit_stores env dbg new_args rd;
set_traps_for_raise env;
ret rd
| Iprobe _ ->
Expand Down Expand Up @@ -1444,7 +1444,7 @@ method insert_move_extcall_arg env _ty_arg src dst =
for example a "32-bit move" instruction for int32 arguments. *)
self#insert_moves env src dst

method emit_stores env data regs_addr =
method emit_stores env dbg data regs_addr =
let a =
ref (Arch.offset_addressing Arch.identity_addressing (-Arch.size_int)) in
List.iter
Expand All @@ -1465,13 +1465,14 @@ method emit_stores env data regs_addr =
Onetwentyeight_unaligned
| Val | Addr | Int -> Word_val
in
self#insert env
self#insert_debug env
(Iop(Istore(kind, !a, false)))
dbg
(Array.append [|r|] regs_addr) [||];
a := Arch.offset_addressing !a (size_component r.typ)
done
| _ ->
self#insert env (Iop op) (Array.append regs regs_addr) [||];
self#insert_debug env (Iop op) dbg (Array.append regs regs_addr) [||];
a := Arch.offset_addressing !a (size_expr env e))
data

Expand Down
2 changes: 1 addition & 1 deletion backend/selectgen.mli
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class virtual selector_generic : object
environment -> Cmm.exttype list -> Cmm.expression list -> Reg.t array * int
(* Can be overridden to deal with stack-based calling conventions *)
method emit_stores :
environment -> Cmm.expression list -> Reg.t array -> unit
environment -> Debuginfo.t -> Cmm.expression list -> Reg.t array -> unit
(* Fill a freshly allocated block. Can be overridden for architectures
that do not provide Arch.offset_addressing. *)

Expand Down

0 comments on commit 8600190

Please sign in to comment.