Skip to content

Commit f51c956

Browse files
committed
Renamed more files
1 parent 40f4d4e commit f51c956

18 files changed

+65
-67
lines changed

compiler/bin-wasm_of_ocaml/compile.ml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ let update_sourcemap ~sourcemap_root ~sourcemap_don't_inline_content sourcemap_f
4343
else
4444
Some
4545
(List.map source_map.sources ~f:(fun file ->
46-
if String.equal file Wa_source_map.blackbox_filename
46+
if String.equal file Wasm_source_map.blackbox_filename
4747
then
48-
Some (Source_map.Source_content.create Wa_source_map.blackbox_contents)
48+
Some (Source_map.Source_content.create Wasm_source_map.blackbox_contents)
4949
else if Sys.file_exists file && not (Sys.is_directory file)
5050
then Some (Source_map.Source_content.create (Fs.read_file file))
5151
else None))
@@ -56,8 +56,8 @@ let update_sourcemap ~sourcemap_root ~sourcemap_don't_inline_content sourcemap_f
5656
; sourceroot =
5757
(if Option.is_some sourcemap_root then sourcemap_root else source_map.sourceroot)
5858
; ignore_list =
59-
(if List.mem Wa_source_map.blackbox_filename ~set:source_map.sources
60-
then [ Wa_source_map.blackbox_filename ]
59+
(if List.mem Wasm_source_map.blackbox_filename ~set:source_map.sources
60+
then [ Wasm_source_map.blackbox_filename ]
6161
else [])
6262
}
6363
in
@@ -214,7 +214,7 @@ let build_js_runtime ~primitives ?runtime_arguments () =
214214
| Javascript.Expression_statement e, N -> e
215215
| _ -> assert false
216216
in
217-
let prelude = Wa_link.output_js always_required_js in
217+
let prelude = Link.output_js always_required_js in
218218
let init_fun =
219219
match Parse_js.parse (Parse_js.Lexer.of_string Wa_runtime.js_runtime) with
220220
| [ (Expression_statement f, _) ] -> f
@@ -230,7 +230,7 @@ let build_js_runtime ~primitives ?runtime_arguments () =
230230
in
231231
[ Javascript.Expression_statement js, Javascript.N ]
232232
in
233-
Wa_link.output_js js
233+
Link.output_js js
234234
in
235235
prelude ^ launcher
236236

@@ -241,13 +241,13 @@ let add_source_map sourcemap_don't_inline_content z opt_source_map_file =
241241
if not sourcemap_don't_inline_content
242242
then
243243
let sm = Source_map.of_file file in
244-
Wa_source_map.iter_sources sm (fun i j file ->
244+
Wasm_source_map.iter_sources sm (fun i j file ->
245245
if Sys.file_exists file && not (Sys.is_directory file)
246246
then
247247
let sm = Fs.read_file file in
248248
Zip.add_entry
249249
z
250-
~name:(Wa_link.source_name i j file)
250+
~name:(Link.source_name i j file)
251251
~contents:(Yojson.Basic.to_string (`String sm))))
252252
opt_source_map_file
253253

@@ -348,8 +348,8 @@ let run
348348
link_runtime ~profile runtime_wasm_files tmp_wasm_file;
349349
let primitives =
350350
tmp_wasm_file
351-
|> (fun file -> Wa_link.Wasm_binary.read_imports ~file)
352-
|> List.filter_map ~f:(fun { Wa_link.Wasm_binary.module_; name; _ } ->
351+
|> (fun file -> Link.Wasm_binary.read_imports ~file)
352+
|> List.filter_map ~f:(fun { Link.Wasm_binary.module_; name; _ } ->
353353
if String.equal module_ "js" then Some name else None)
354354
|> StringSet.of_list
355355
in
@@ -358,7 +358,7 @@ let run
358358
Zip.add_file z ~name:"runtime.wasm" ~file:tmp_wasm_file;
359359
Zip.add_entry z ~name:"runtime.js" ~contents:js_runtime;
360360
let predefined_exceptions = build_prelude z in
361-
Wa_link.add_info
361+
Link.add_info
362362
z
363363
~predefined_exceptions
364364
~build_info:(Build_info.create `Runtime)
@@ -405,7 +405,7 @@ let run
405405
~opt_output_sourcemap:opt_tmp_map_file
406406
~input_file:wat_file
407407
~output_file:tmp_wasm_file;
408-
{ Wa_link.unit_name; unit_info; strings; fragments }
408+
{ Link.unit_name; unit_info; strings; fragments }
409409
in
410410
cont unit_data unit_name tmp_wasm_file opt_tmp_map_file
411411
in
@@ -425,7 +425,7 @@ let run
425425
Fs.gen_file (Filename.chop_extension output_file ^ ".wat")
426426
@@ fun wat_file ->
427427
let dir = Filename.chop_extension output_file ^ ".assets" in
428-
Wa_link.gen_dir dir
428+
Link.gen_dir dir
429429
@@ fun tmp_dir ->
430430
Sys.mkdir tmp_dir 0o777;
431431
let opt_sourcemap =
@@ -455,21 +455,21 @@ let run
455455
if enable_source_maps
456456
then (
457457
Sys.rename (Filename.concat tmp_dir "code.wasm.map") (tmp_wasm_file' ^ ".map");
458-
Wa_link.Wasm_binary.append_source_map_section
458+
Link.Wasm_binary.append_source_map_section
459459
~file:tmp_wasm_file'
460460
~url:(wasm_name ^ ".wasm.map"));
461461
let js_runtime =
462462
let missing_primitives =
463-
let l = Wa_link.Wasm_binary.read_imports ~file:tmp_wasm_file' in
463+
let l = Link.Wasm_binary.read_imports ~file:tmp_wasm_file' in
464464
List.filter_map
465-
~f:(fun { Wa_link.Wasm_binary.module_; name; _ } ->
465+
~f:(fun { Link.Wasm_binary.module_; name; _ } ->
466466
if String.equal module_ "env" then Some name else None)
467467
l
468468
in
469469
build_js_runtime
470470
~primitives
471471
~runtime_arguments:
472-
(Wa_link.build_runtime_arguments
472+
(Link.build_runtime_arguments
473473
~missing_primitives
474474
~wasm_dir:dir
475475
~link_spec:[ wasm_name, None ]
@@ -492,7 +492,7 @@ let run
492492
unit_data)
493493
in
494494
let unit_data = [ compile_cmo' z cmo ] in
495-
Wa_link.add_info z ~build_info:(Build_info.create `Cmo) ~unit_data ();
495+
Link.add_info z ~build_info:(Build_info.create `Cmo) ~unit_data ();
496496
Zip.close_out z
497497
| `Cma cma ->
498498
Fs.gen_file output_file
@@ -531,7 +531,7 @@ let run
531531
List.map ~f:(fun (unit_data, _, _, _) -> unit_data) l)
532532
[]
533533
in
534-
Wa_link.add_info z ~build_info:(Build_info.create `Cma) ~unit_data ();
534+
Link.add_info z ~build_info:(Build_info.create `Cma) ~unit_data ();
535535
Zip.close_out z);
536536
close_ic ());
537537
Debug.stop_profiling ()

compiler/bin-wasm_of_ocaml/link.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ let options =
8181
let f { common; output_file; files; linkall; enable_source_maps; mklib } =
8282
Js_of_ocaml_compiler.Config.set_target `Wasm;
8383
Jsoo_cmdline.Arg.eval common;
84-
Wa_link.link ~output_file ~linkall ~mklib ~enable_source_maps ~files
84+
Link.link ~output_file ~linkall ~mklib ~enable_source_maps ~files
8585

8686
let info =
8787
Info.make

compiler/lib-wasm/wa_code_generation.ml renamed to compiler/lib-wasm/code_generation.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ let event loc : unit t =
292292
| Event _ :: instrs | instrs -> { st with instrs = Event loc :: instrs } )
293293

294294
let hidden_location =
295-
{ Parse_info.src = Some Wa_source_map.blackbox_filename
295+
{ Parse_info.src = Some Wasm_source_map.blackbox_filename
296296
; name = None
297297
; col = 0
298298
; line = 1
File renamed without changes.

compiler/lib-wasm/curry.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
open! Stdlib
2020
open Code
2121
module W = Wasm_ast
22-
open Wa_code_generation
22+
open Code_generation
2323

2424
module Make (Target : Wa_target_sig.S) = struct
2525
open Target

compiler/lib-wasm/curry.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
*)
1818

1919
module Make (_ : Wa_target_sig.S) : sig
20-
val f : context:Wa_code_generation.context -> unit
20+
val f : context:Code_generation.context -> unit
2121
end
File renamed without changes.
File renamed without changes.

compiler/lib-wasm/wa_link.ml renamed to compiler/lib-wasm/link.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ let extract_source_map ~dir ~name z =
585585
| Some map -> Build_path_prefix_map.rewrite map path
586586
| None -> path
587587
in
588-
Wa_source_map.insert_source_contents ~rewrite_path sm (fun i j file ->
588+
Wasm_source_map.insert_source_contents ~rewrite_path sm (fun i j file ->
589589
let name = source_name i j file in
590590
if Zip.has_entry z ~name then Some (Zip.read_entry z ~name) else None)
591591
in
@@ -861,10 +861,10 @@ let rec get_source_map_files files src_index =
861861
then
862862
let data = Zip.read_entry z ~name:"source_map.map" in
863863
let sm = Source_map.of_string data in
864-
if not (Wa_source_map.is_empty sm)
864+
if not (Wasm_source_map.is_empty sm)
865865
then (
866866
let l = ref [] in
867-
Wa_source_map.iter_sources sm (fun i j file -> l := source_name i j file :: !l);
867+
Wasm_source_map.iter_sources sm (fun i j file -> l := source_name i j file :: !l);
868868
if not (List.is_empty !l)
869869
then z, Array.of_list (List.rev !l)
870870
else (
@@ -888,7 +888,7 @@ let add_source_map files z opt_source_map_file =
888888
| Some (_, (z', _)) -> Zip.close_in z'
889889
| None -> ()
890890
in
891-
Wa_source_map.iter_sources sm (fun i j file ->
891+
Wasm_source_map.iter_sources sm (fun i j file ->
892892
let z', files =
893893
match !st with
894894
| Some (i', st) when Poly.equal i i' -> st
File renamed without changes.

0 commit comments

Comments
 (0)