Skip to content

Commit b0ff04e

Browse files
authored
Make flambda_backend_objinfo.ml easier to diff with upstream (oxcaml#3167)
1 parent 0b4c008 commit b0ff04e

File tree

2 files changed

+199
-316
lines changed

2 files changed

+199
-316
lines changed

ocaml/tools/objinfo.ml

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,15 @@ let print_impl_import import =
6262
let print_line name =
6363
printf "\t%s\n" name
6464

65-
<<<<<<< HEAD
66-
<<<<<<< HEAD
67-
||||||| 2572783060
68-
=======
6965
let print_global_as_name_line glob =
7066
(* Type will change soon for parameterised libraries *)
7167
printf "\t%a\n" Compilation_unit.Name.output glob
7268

73-
>>>>>>> ocaml-jst/flambda-patches
7469
let print_required_global id =
7570
printf "\t%a\n" Compilation_unit.output id
76-
||||||| 121bedcfd2
77-
let print_required_global id =
78-
printf "\t%s\n" (Ident.name id)
79-
=======
80-
let print_required_compunit (Compunit cu_name) =
81-
printf "\t%s\n" cu_name
82-
>>>>>>> 5.2.0
8371

8472
let print_cmo_infos cu =
85-
<<<<<<< HEAD
8673
printf "Unit name: %a\n" Compilation_unit.output cu.cu_name;
87-
||||||| 121bedcfd2
88-
printf "Unit name: %s\n" cu.cu_name;
89-
=======
90-
printf "Unit name: %s\n" (Symtable.Compunit.name cu.cu_name);
91-
>>>>>>> 5.2.0
9274
print_string "Interfaces imported:\n";
9375
Array.iter print_intf_import cu.cu_imports;
9476
print_string "Required globals:\n";
@@ -118,14 +100,7 @@ let print_cma_infos (lib : Cmo_format.library) =
118100
printf "\n";
119101
List.iter print_cmo_infos lib.lib_units
120102

121-
<<<<<<< HEAD
122-
<<<<<<< HEAD
123-
let print_cmi_infos name crcs kind =
124-
||||||| 2572783060
125-
let print_cmi_infos name crcs kind =
126-
=======
127103
let print_cmi_infos name crcs kind params =
128-
>>>>>>> ocaml-jst/flambda-patches
129104
if not !quiet then begin
130105
let open Cmi_format in
131106
printf "Unit name: %a\n" Compilation_unit.Name.output name;
@@ -140,23 +115,9 @@ let print_cmi_infos name crcs kind params =
140115
printf "Interfaces imported:\n";
141116
Array.iter print_intf_import crcs
142117
end
143-
||||||| 121bedcfd2
144-
let print_cmi_infos name crcs =
145-
printf "Unit name: %s\n" name;
146-
printf "Interfaces imported:\n";
147-
List.iter print_name_crc crcs
148-
=======
149-
let print_cmi_infos name crcs =
150-
if not !quiet then begin
151-
printf "Unit name: %s\n" name;
152-
printf "Interfaces imported:\n";
153-
List.iter print_name_crc crcs
154-
end
155-
>>>>>>> 5.2.0
156118

157119
let print_cmt_infos cmt =
158120
let open Cmt_format in
159-
<<<<<<< HEAD
160121
if not !quiet then begin
161122
printf "Cmt unit name: %a\n" Compilation_unit.output cmt.cmt_modname;
162123
print_string "Cmt interfaces imported:\n";
@@ -175,47 +136,11 @@ let print_cmt_infos cmt =
175136
| None -> ""
176137
| Some crc -> string_of_crc crc);
177138
end;
178-
||||||| 121bedcfd2
179-
printf "Cmt unit name: %s\n" cmt.cmt_modname;
180-
print_string "Cmt interfaces imported:\n";
181-
List.iter print_name_crc cmt.cmt_imports;
182-
printf "Source file: %s\n"
183-
(match cmt.cmt_sourcefile with None -> "(none)" | Some f -> f);
184-
printf "Compilation flags:";
185-
Array.iter print_spaced_string cmt.cmt_args;
186-
printf "\nLoad path:";
187-
List.iter print_spaced_string cmt.cmt_loadpath;
188-
printf "\n";
189-
printf "cmt interface digest: %s\n"
190-
(match cmt.cmt_interface_digest with
191-
| None -> ""
192-
| Some crc -> string_of_crc crc);
193-
=======
194-
if not !quiet then begin
195-
printf "Cmt unit name: %s\n" cmt.cmt_modname;
196-
print_string "Cmt interfaces imported:\n";
197-
List.iter print_name_crc cmt.cmt_imports;
198-
printf "Source file: %s\n"
199-
(match cmt.cmt_sourcefile with None -> "(none)" | Some f -> f);
200-
printf "Compilation flags:";
201-
Array.iter print_spaced_string cmt.cmt_args;
202-
printf "\nLoad path:\n Visible:";
203-
List.iter print_spaced_string cmt.cmt_loadpath.visible;
204-
printf "\n Hidden:";
205-
List.iter print_spaced_string cmt.cmt_loadpath.hidden;
206-
printf "\n";
207-
printf "cmt interface digest: %s\n"
208-
(match cmt.cmt_interface_digest with
209-
| None -> ""
210-
| Some crc -> string_of_crc crc);
211-
end;
212-
>>>>>>> 5.2.0
213139
if !shape then begin
214140
printf "Implementation shape: ";
215141
(match cmt.cmt_impl_shape with
216142
| None -> printf "(none)\n"
217143
| Some shape -> Format.printf "\n%a" Shape.print shape)
218-
<<<<<<< HEAD
219144
end;
220145
if !index then begin
221146
printf "Indexed shapes:\n";
@@ -263,56 +188,6 @@ let print_cmt_infos cmt =
263188
pp_loc loc)
264189
cmt.cmt_uid_to_decl;
265190
Format.print_flush ()
266-
||||||| 121bedcfd2
267-
=======
268-
end;
269-
if !index then begin
270-
printf "Indexed shapes:\n";
271-
List.iter (fun (loc, item) ->
272-
let pp_loc fmt { Location.txt; loc } =
273-
Format.fprintf fmt "%a (%a)"
274-
Pprintast.longident txt Location.print_loc loc
275-
in
276-
Format.printf "@[<hov 2>%a:@ %a@]@;"
277-
Shape_reduce.print_result item pp_loc loc)
278-
cmt.cmt_ident_occurrences;
279-
Format.print_flush ()
280-
end;
281-
if !decls then begin
282-
printf "\nUid of decls:\n";
283-
Shape.Uid.Tbl.iter (fun uid item ->
284-
let loc = match (item : Typedtree.item_declaration) with
285-
| Value vd -> vd.val_name
286-
| Value_binding vb ->
287-
let (_, name, _, _) =
288-
List.hd (Typedtree.let_bound_idents_full [vb])
289-
in
290-
name
291-
| Type td -> td.typ_name
292-
| Constructor cd -> cd.cd_name
293-
| Extension_constructor ec -> ec.ext_name
294-
| Label ld -> ld.ld_name
295-
| Module md ->
296-
{ md.md_name with
297-
txt = Option.value md.md_name.txt ~default:"_" }
298-
| Module_substitution ms -> ms.ms_name
299-
| Module_binding mb ->
300-
{ mb.mb_name with
301-
txt = Option.value mb.mb_name.txt ~default:"_" }
302-
| Module_type mtd -> mtd.mtd_name
303-
| Class cd -> cd.ci_id_name
304-
| Class_type ctd -> ctd.ci_id_name
305-
in
306-
let pp_loc fmt { Location.txt; loc } =
307-
Format.fprintf fmt "%s (%a)"
308-
txt Location.print_loc loc
309-
in
310-
Format.printf "@[<hov 2>%a:@ %a@]@;"
311-
Shape.Uid.print uid
312-
pp_loc loc)
313-
cmt.cmt_uid_to_decl;
314-
Format.print_flush ()
315-
>>>>>>> 5.2.0
316191
end
317192

318193
let print_cms_infos cms =

0 commit comments

Comments
 (0)