Skip to content

Commit 1c4c2a6

Browse files
authored
Remove one #ifdef RELEASE (rescript-lang#6159)
1 parent 3b136e8 commit 1c4c2a6

9 files changed

+8
-30
lines changed

jscomp/common/ext_log.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type 'a logging = ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a
2626

2727
(* TODO: add {[@.]} later for all *)
2828
let dwarn ?(__POS__ : (string * int * int * int) option) f =
29-
if Js_config.get_diagnose () then
29+
if !Js_config.diagnose then
3030
match __POS__ with
3131
| None -> Format.fprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.")
3232
| Some (file, line, _, _) ->

jscomp/common/js_config.ml

-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ let directives = ref []
3434
let cross_module_inline = ref false
3535
let diagnose = ref false
3636

37-
let get_diagnose () =
38-
!diagnose
39-
#ifndef RELEASE
40-
|| Sys.getenv_opt "RES_DEBUG_FILE" <> None
41-
#endif
42-
4337
(* let (//) = Filename.concat *)
4438

4539
(* let get_packages_info () = !packages_info *)

jscomp/common/js_config.mli

-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ val cross_module_inline : bool ref
5252
val diagnose : bool ref
5353
(** diagnose option *)
5454

55-
val get_diagnose : unit -> bool
56-
(* val set_diagnose : bool -> unit *)
57-
5855
val no_builtin_ppx : bool ref
5956
(** options for builtin ppx *)
6057

jscomp/core/bs_cmi_load.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ let load_cmi ~unit_name : Env.Persistent_signature.t option =
4747
let {Cmij_cache.module_names; module_data} = Lazy.force cmi_cache in
4848
match Ext_string_array.find_sorted module_names unit_name with
4949
| Some index ->
50-
if Js_config.get_diagnose () then
50+
if !Js_config.diagnose then
5151
Format.fprintf Format.err_formatter ">Cmi: %s@." unit_name;
5252
let cmi = Cmij_cache.unmarshal_cmi_data module_data.(index) in
53-
if Js_config.get_diagnose () then
53+
if !Js_config.diagnose then
5454
Format.fprintf Format.err_formatter "<Cmi: %s@." unit_name;
5555
Some {filename = Sys.executable_name ;
5656
cmi }

jscomp/core/js_cmj_load_builtin_unit.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let load_builin_unit (unit_name : string) : Js_cmj_format.cmj_load_info =
3939
let { Cmij_cache.module_names; module_data } = Lazy.force cmj_cache in
4040
match Ext_string_array.find_sorted module_names unit_name with
4141
| Some i ->
42-
if Js_config.get_diagnose () then
42+
if !Js_config.diagnose then
4343
Format.fprintf Format.err_formatter ">Cmj: %s@." unit_name;
4444
let cmj_table : Js_cmj_format.t =
4545
let { Cmij_cache.values; pure } =
@@ -53,7 +53,7 @@ let load_builin_unit (unit_name : string) : Js_cmj_format.cmj_load_info =
5353
}
5454
(* FIXME when we change it *)
5555
in
56-
if Js_config.get_diagnose () then
56+
if !Js_config.diagnose then
5757
Format.fprintf Format.err_formatter "<Cmj: %s@." unit_name;
5858
{
5959
package_path = Filename.dirname (Filename.dirname Sys.executable_name);

jscomp/core/js_pass_debug.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let log_counter = ref 0
3535
let dump name (prog : J.program) =
3636
begin
3737
let () =
38-
if Js_config.get_diagnose ()
38+
if !Js_config.diagnose
3939
then
4040
begin
4141
incr log_counter ;

jscomp/core/lam_compile_main.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ let compile
208208
#ifndef RELEASE
209209
let () =
210210
Ext_log.dwarn ~__POS__ "After coercion: %a@." Lam_stats.print meta ;
211-
if Js_config.get_diagnose () then
211+
if !Js_config.diagnose then
212212
let f =
213213
Ext_filename.new_extension !Location.input_name ".lambda" in
214214
Ext_fmt.with_file_as_pp f begin fun fmt ->

jscomp/core/lam_util.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ let dump ext lam =
217217
#else
218218
let log_counter = ref 0
219219
let dump ext lam =
220-
if Js_config.get_diagnose ()
220+
if !Js_config.diagnose
221221
then
222222
(* ATTENTION: easy to introduce a bug during refactoring when forgeting `begin` `end`*)
223223
begin

scripts/dbg

-13
This file was deleted.

0 commit comments

Comments
 (0)