Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#### :house: Internal

- Remove unused compiler IR definitions, modules, helpers, error variants, and Typedtree fields. https://github.com/rescript-lang/rescript/pull/8551 https://github.com/rescript-lang/rescript/pull/8555
- Add the `-check-lam` compiler option, enable Lambda invariant checking in compiler tests, and remove build-profile-dependent checking. https://github.com/rescript-lang/rescript/pull/8534
- Replace `-bs-diagnose` with `-debug-ir` and make IR diagnostic artifacts deterministic, compilation-local, and easy to clean. https://github.com/rescript-lang/rescript/pull/8535
- Replace CPPO-based browser conditionals with Dune-selected native and playground compiler implementations. https://github.com/rescript-lang/rescript/pull/8541
Expand Down
1 change: 0 additions & 1 deletion compiler/common/js_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ let check_lam = ref false
let no_builtin_ppx = ref false
let tool_name = "ReScript"
let check_div_by_zero = ref true
let get_check_div_by_zero () = !check_div_by_zero
let syntax_only = ref false
let binary_ast = ref false
let test_ast_conversion = ref false
Expand Down
2 changes: 0 additions & 2 deletions compiler/common/js_config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ val no_builtin_ppx : bool ref
val check_div_by_zero : bool ref
(** check-div-by-zero option *)

val get_check_div_by_zero : unit -> bool

val tool_name : string

val syntax_only : bool ref
Expand Down
7 changes: 0 additions & 7 deletions compiler/core/js_cmj_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ let from_file name : t =
close_in ic;
v

let from_file_with_digest name : t * Digest.t =
let ic = open_in_bin name in
let digest = Digest.input ic in
let v : t = input_value ic in
close_in ic;
(v, digest)

let from_string s : t = Marshal.from_string s Ext_digest.length

let for_sure_not_changed (name : string) (header : string) =
Expand Down
2 changes: 0 additions & 2 deletions compiler/core/js_cmj_format.mli
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ val single_na : arity

val from_file : string -> t

val from_file_with_digest : string -> t * Digest.t

val from_string : string -> t

(*
Expand Down
13 changes: 0 additions & 13 deletions compiler/core/js_cmj_load.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@
make sure that the distributed files are platform independent
*)

(*
let load_unit_no_file unit_name : Js_cmj_format.cmj_load_info =
let file = unit_name ^ Literals.suffix_cmj in
match Config_util.find_opt file with
| Some f
->
{package_path =
(** hacking relying on the convention of pkg/lib/ocaml/xx.cmj*)
Filename.dirname (Filename.dirname (Filename.dirname f));
cmj_table = Js_cmj_format.from_file f}
| None ->
Bs_exception.error (Cmj_not_found unit_name) *)

let load_unit_with_file unit_name : Js_cmj_format.cmj_load_info =
let file = unit_name ^ Literals.suffix_cmj in
match Config_util.find_opt file with
Expand Down
9 changes: 0 additions & 9 deletions compiler/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,6 @@ let rec exp_need_paren ?(arrow = false) (e : J.expression) =
| Optional_block (e, true) when arrow -> exp_need_paren ~arrow e
| Optional_block _ -> false

(** Print as underscore for unused vars, may not be
needed in the future *)
(* let ipp_ident cxt f id (un_used : bool) =
Ext_pp_scope.ident cxt f (
if un_used then
Ext_ident.make_unused ()
else
id) *)

let pp_var_assign cxt f id =
P.string f L.let_;
P.space f;
Expand Down
35 changes: 0 additions & 35 deletions compiler/core/js_exp_make.ml
Original file line number Diff line number Diff line change
Expand Up @@ -583,44 +583,9 @@ let extension_access (e : t) name (pos : int32) : t =
source_loc = None;
}

let string_index ?comment (e0 : t) (e1 : t) : t =
match (e0.expression_desc, e1.expression_desc) with
| Str {txt}, Number (Int {i; _}) ->
(* Don't optimize {j||j} *)
let i = Int32.to_int i in
if i >= 0 && i < String.length txt then
(* TODO: check exception when i is out of range..
RangeError?
*)
str (String.make 1 txt.[i])
else {expression_desc = String_index (e0, e1); comment; source_loc = None}
| _ -> {expression_desc = String_index (e0, e1); comment; source_loc = None}

let assign ?comment e0 e1 : t =
{expression_desc = Bin (Eq, e0, e1); comment; source_loc = None}

let assign_by_exp (e : t) index value : t =
match e.expression_desc with
| Array _
(*
Temporary block -- address not held
Optimize cases like this which is really
rare {[
(ref x) := 3
]}
*)
| Caml_block _
when no_side_effect e && no_side_effect index ->
value
| _ ->
assign
{
expression_desc = Array_index (e, index);
comment = None;
source_loc = None;
}
value

let record_assign (e : t) (pos : int32) (name : string) (value : t) =
match e.expression_desc with
| Array _
Expand Down
4 changes: 0 additions & 4 deletions compiler/core/js_exp_make.mli
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ val string_append : ?comment:string -> t -> t -> t
we can not tag [js] object, since it can be frozen
*)

val string_index : ?comment:string -> t -> t -> t

val array_index : ?comment:string -> t -> t -> t

val array_index_by_int : ?comment:string -> t -> Int32.t -> t
Expand All @@ -165,8 +163,6 @@ val poly_var_value_access : t -> t

val extension_assign : t -> int32 -> string -> t -> t

val assign_by_exp : t -> t -> t -> t

val assign : ?comment:string -> t -> t -> t

val tag_type : Ast_untagged_variants.tag_type -> t
Expand Down
Loading
Loading