Skip to content

Commit

Permalink
No longer ignore always annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Sep 11, 2024
1 parent c758982 commit a02584d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 0 additions & 2 deletions compiler/bin-wasm_of_ocaml/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,10 @@ let run
let filename = Builtins.File.name t in
let runtimes = Linker.Fragment.parse_builtin t in
Linker.load_fragments
~ignore_always_annotation:true
~target_env:Target_env.Isomorphic
~filename
runtimes);
Linker.load_files
~ignore_always_annotation:true
~target_env:Target_env.Isomorphic
runtime_js_files;
Linker.check_deps ();
Expand Down
16 changes: 7 additions & 9 deletions compiler/lib/linker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ let list_all ?from () =
provided
StringSet.empty

let load_fragment ~ignore_always_annotation ~target_env ~filename (f : Fragment.t) =
let load_fragment ~target_env ~filename (f : Fragment.t) =
match f with
| Always_include code ->
always_included :=
Expand Down Expand Up @@ -482,8 +482,6 @@ let load_fragment ~ignore_always_annotation ~target_env ~filename (f : Fragment.
filename;
if always
then (
if not ignore_always_annotation
then
always_included :=
{ ar_filename = filename; ar_program = code; ar_requires = requires }
:: !always_included;
Expand Down Expand Up @@ -588,24 +586,24 @@ let check_deps () =
())
code_pieces

let load_file ~ignore_always_annotation ~target_env filename =
let load_file ~target_env filename =
List.iter (Fragment.parse_file filename) ~f:(fun frag ->
let (`Ok | `Ignored) =
load_fragment ~ignore_always_annotation ~target_env ~filename frag
load_fragment ~target_env ~filename frag
in
())

let load_fragments ?(ignore_always_annotation = false) ~target_env ~filename l =
let load_fragments ~target_env ~filename l =
List.iter l ~f:(fun frag ->
let (`Ok | `Ignored) =
load_fragment ~ignore_always_annotation ~target_env ~filename frag
load_fragment ~target_env ~filename frag
in
());
check_deps ()

let load_files ?(ignore_always_annotation = false) ~target_env l =
let load_files ~target_env l =
List.iter l ~f:(fun filename ->
load_file ~ignore_always_annotation ~target_env filename);
load_file ~target_env filename);
check_deps ()

(* resolve *)
Expand Down
5 changes: 2 additions & 3 deletions compiler/lib/linker.mli
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ end
val reset : unit -> unit

val load_files :
?ignore_always_annotation:bool -> target_env:Target_env.t -> string list -> unit
target_env:Target_env.t -> string list -> unit

val load_fragments :
?ignore_always_annotation:bool
-> target_env:Target_env.t
target_env:Target_env.t
-> filename:string
-> Fragment.t list
-> unit
Expand Down

0 comments on commit a02584d

Please sign in to comment.