Skip to content

Commit 5429b7e

Browse files
committed
Command line option to use the new exception handling instructions
1 parent 6de0001 commit 5429b7e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

compiler/lib-wasm/binaryen.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ let optimize
134134
("wasm-opt"
135135
:: (common_options ()
136136
@ (if Config.Flag.trap_on_exception () then [] else [ "--traps-never-happen" ])
137+
@ (if Config.Flag.use_new_eh () then [ "--translate-to-new-eh" ] else [])
137138
@ Option.value ~default:optimization_options.(level - 1) options
138139
@ [ Filename.quote input_file; "-o"; Filename.quote output_file ])
139140
@ opt_flag "--input-source-map" opt_input_sourcemap

compiler/lib/config.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ module Flag = struct
105105
let wasi = o ~name:"wasi" ~default:false
106106

107107
let trap_on_exception = o ~name:"trap-on-exception" ~default:false
108+
109+
let use_new_eh = o ~name:"use-new-eh" ~default:false
108110
end
109111

110112
module Param = struct

compiler/lib/config.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ module Flag : sig
8080

8181
val trap_on_exception : unit -> bool
8282

83+
val use_new_eh : unit -> bool
84+
8385
val enable : string -> unit
8486

8587
val disable : string -> unit

0 commit comments

Comments
 (0)