Skip to content

Commit fdaa723

Browse files
committed
Encode and decode DW_AT_rust_iterator on DW_TAG_subprogram DIEs.
1 parent ddf49af commit fdaa723

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/boot/me/dwarf.ml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,7 @@ let (abbrev_subprogram:abbrev) =
12031203
(DW_AT_return_addr, DW_FORM_block1);
12041204
(DW_AT_mutable, DW_FORM_flag);
12051205
(DW_AT_pure, DW_FORM_flag);
1206+
(DW_AT_rust_iterator, DW_FORM_flag);
12061207
|])
12071208
;;
12081209

@@ -2295,6 +2296,7 @@ let dwarf_visitor
22952296
(id:Ast.ident)
22962297
(ret_slot:Ast.slot)
22972298
(effect:Ast.effect)
2299+
(iter:bool)
22982300
(fix:fixup)
22992301
: unit =
23002302
(* NB: retpc = "top word of frame-base" by convention in ABI/x86. *)
@@ -2314,6 +2316,8 @@ let dwarf_visitor
23142316
(* DW_AT_return_addr *)
23152317
dw_form_block1 [| DW_OP_fbreg (Asm.IMM retpc); |];
23162318
encode_effect effect;
2319+
(* DW_AT_rust_iterator: DW_FORM_flag *)
2320+
BYTE (if iter then 1 else 0)
23172321
|])
23182322
in
23192323
emit_die subprogram_die
@@ -2388,7 +2392,8 @@ let dwarf_visitor
23882392
(path_name())
23892393
(Array.length item.node.Ast.decl_params);
23902394
emit_subprogram_die
2391-
id tsig.Ast.sig_output_slot taux.Ast.fn_effect
2395+
id tsig.Ast.sig_output_slot
2396+
taux.Ast.fn_effect taux.Ast.fn_is_iter
23922397
(Hashtbl.find cx.ctxt_fn_fixups item.id);
23932398
emit_type_param_decl_dies item.node.Ast.decl_params;
23942399
end
@@ -3132,9 +3137,10 @@ let rec extract_mod_items
31323137
let ident = get_name die in
31333138
let oslot = get_referenced_slot die in
31343139
let effect = get_effect die in
3140+
let iter = get_flag die DW_AT_rust_iterator in
31353141
let (params, islots) = get_formals die in
31363142
let taux = { Ast.fn_effect = effect;
3137-
Ast.fn_is_iter = false }
3143+
Ast.fn_is_iter = iter }
31383144
in
31393145
let tfn = { Ast.fn_input_slots = form_header_slots islots;
31403146
Ast.fn_input_constrs = [| |];

0 commit comments

Comments
 (0)