Skip to content

Commit

Permalink
restore optimization in Ctype.deep_occur + remove obsolete Btype.set_…
Browse files Browse the repository at this point in the history
…typeset
  • Loading branch information
garrigue committed Dec 14, 2020
1 parent 3681071 commit 273bf4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Working version
- #9650, #9651: keep refactoring the pattern-matching compiler
(Gabriel Scherer, review by Thomas Refis and Florian Angeletti)

- #9994: Make Types.type_expr a private type, and abstract marking mechanism
(Jacques Garrigue and Takafumi Saikawa,
review by Gabriel Scherer and Leo White)

- #10007: Driver.compile_common: when typing a .ml file, return the
compilation unit signature (inferred or from the .cmi) in addition
to the implementation and the coercion.
Expand Down
5 changes: 0 additions & 5 deletions typing/btype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,6 @@ let undo_change = function
| Ckind (r, v) -> r := v
| Ccommu (r, v) -> r := v
| Cuniv (r, v) -> r := v
(* | Ctypeset (r, v) -> r := v *)

type snapshot = changes ref * int
let last_snapshot = s_ref 0
Expand Down Expand Up @@ -787,10 +786,6 @@ let set_kind rk k =
log_change (Ckind (rk, !rk)); rk := Some k
let set_commu rc c =
log_change (Ccommu (rc, !rc)); rc := c
(*
let set_typeset rs s =
log_change (Ctypeset (rs, !rs)); rs := s
*)

let snapshot () =
let old = !last_snapshot in
Expand Down
9 changes: 4 additions & 5 deletions typing/ctype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2105,11 +2105,10 @@ let expand_trace env trace =
let deep_occur t0 ty =
let rec occur_rec ty =
let ty = repr ty in
if try_mark_node ty then
begin
if ty == t0 then raise Occur;
iter_type_expr occur_rec ty
end
if ty.level >= t0.level && try_mark_node ty then begin
if ty == t0 then raise Occur;
iter_type_expr occur_rec ty
end
in
try
occur_rec ty; unmark_type ty; false
Expand Down

0 comments on commit 273bf4c

Please sign in to comment.