@@ -12,8 +12,8 @@ pub struct Options {
1212 /// Enable debug logging
1313 pub debug : bool ,
1414
15- /// Dump High-level IR generated from ISEQ.
16- pub dump_hir : Option < DumpHIR > ,
15+ /// Dump initial High-level IR before optimization
16+ pub dump_hir_init : Option < DumpHIR > ,
1717
1818 /// Dump High-level IR after optimization, right before codegen.
1919 pub dump_hir_opt : Option < DumpHIR > ,
@@ -58,7 +58,7 @@ pub extern "C" fn rb_zjit_init_options() -> *const u8 {
5858pub fn init_options ( ) -> Options {
5959 Options {
6060 debug : false ,
61- dump_hir : None ,
61+ dump_hir_init : None ,
6262 dump_hir_opt : None ,
6363 dump_disasm : false ,
6464 }
@@ -97,13 +97,14 @@ fn parse_option(options: &mut Options, str_ptr: *const std::os::raw::c_char) ->
9797
9898 ( "debug" , "" ) => options. debug = true ,
9999
100- ( "dump-hir" , "" ) => options. dump_hir = Some ( DumpHIR :: WithoutSnapshot ) ,
101- ( "dump-hir" , "all" ) => options. dump_hir = Some ( DumpHIR :: All ) ,
102- ( "dump-hir" , "debug" ) => options. dump_hir = Some ( DumpHIR :: Debug ) ,
100+ // --zjit-dump-hir dumps the actual input to the codegen, which is currently the same as --zjit-dump-hir-opt.
101+ ( "dump-hir" | "dump-hir-opt" , "" ) => options. dump_hir_opt = Some ( DumpHIR :: WithoutSnapshot ) ,
102+ ( "dump-hir" | "dump-hir-opt" , "all" ) => options. dump_hir_opt = Some ( DumpHIR :: All ) ,
103+ ( "dump-hir" | "dump-hir-opt" , "debug" ) => options. dump_hir_opt = Some ( DumpHIR :: Debug ) ,
103104
104- ( "dump-hir-opt " , "" ) => options. dump_hir_opt = Some ( DumpHIR :: WithoutSnapshot ) ,
105- ( "dump-hir-opt " , "all" ) => options. dump_hir_opt = Some ( DumpHIR :: All ) ,
106- ( "dump-hir-opt " , "debug" ) => options. dump_hir_opt = Some ( DumpHIR :: Debug ) ,
105+ ( "dump-hir-init " , "" ) => options. dump_hir_init = Some ( DumpHIR :: WithoutSnapshot ) ,
106+ ( "dump-hir-init " , "all" ) => options. dump_hir_init = Some ( DumpHIR :: All ) ,
107+ ( "dump-hir-init " , "debug" ) => options. dump_hir_init = Some ( DumpHIR :: Debug ) ,
107108
108109 ( "dump-disasm" , "" ) => options. dump_disasm = true ,
109110
0 commit comments