File tree Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ let preprocessor_variables () =
8484 | `Disabled | `Jspi -> " jspi"
8585 | `Cps -> " cps"
8686 | `Double_translation -> assert false ) )
87+ ; " exnref" , Wat_preprocess. Bool (Config.Flag. exnref () )
8788 ]
8889
8990let with_runtime_files ~runtime_wasm_files f =
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ let check_js_file fname =
7575(* Keep the two variables below in sync with function build_runtime in
7676 ../compile.ml *)
7777
78- let default_flags = []
78+ let default_flags = [ " exnref " , `B false ]
7979
8080let interesting_runtimes = [ [ " effects" , `S " jspi" ]; [ " effects" , `S " cps" ] ]
8181
Original file line number Diff line number Diff line change @@ -135,11 +135,11 @@ let optimize
135135 ~output_file
136136 () =
137137 command
138- (" wasm-opt"
139- :: ( common_options ()
140- @ (match options with
141- | Some o -> o
142- | None -> optimization_options profile)
143- @ [ Filename. quote input_file; " -o" ; Filename. quote output_file ])
138+ (( " wasm-opt" :: ( if Config.Flag. exnref () then [ " --emit-exnref " ] else [] ))
139+ @ common_options ()
140+ @ (match options with
141+ | Some o -> o
142+ | None -> optimization_options profile)
143+ @ [ Filename. quote input_file; " -o" ; Filename. quote output_file ]
144144 @ opt_flag " --input-source-map" opt_input_sourcemap
145145 @ opt_flag " --output-source-map" opt_output_sourcemap)
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ module Flag = struct
106106 let es6 = o ~name: " es6" ~default: false
107107
108108 let load_shapes_auto = o ~name: " load-shapes-auto" ~default: false
109+
110+ let exnref = o ~name: " exnref" ~default: false
109111end
110112
111113module Param = struct
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ module Flag : sig
7676
7777 val load_shapes_auto : unit -> bool
7878
79+ val exnref : unit -> bool
80+
7981 val enable : string -> unit
8082
8183 val disable : string -> unit
You can’t perform that action at this time.
0 commit comments