Skip to content

Commit

Permalink
Merge pull request #99 from ocaml-wasm/clean-up
Browse files Browse the repository at this point in the history
Clean up: remove unused or duplicated code
  • Loading branch information
vouillon authored Oct 9, 2024
2 parents 5105f11 + f4f188a commit 058036f
Show file tree
Hide file tree
Showing 26 changed files with 264 additions and 3,717 deletions.
2 changes: 1 addition & 1 deletion compiler/lib/generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ and compile_block_no_loop st queue (pc : Addr.t) ~fall_through scope_stack =
| true -> never, [ J.Labelled_statement (l, (J.Block inner, J.N)), J.N ] @ code
| false -> never, inner @ code)
in
let never_after, after = loop ~scope_stack ~fall_through (List.rev new_scopes) in
let never_after, after = loop ~scope_stack ~fall_through new_scopes in
never_after, seq @ after

and compile_decision_tree kind st scope_stack loc cx dtree ~fall_through =
Expand Down
4 changes: 3 additions & 1 deletion compiler/lib/structure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ let is_loop_header g pc =
Addr.Set.exists (fun pc' -> Hashtbl.find g.block_order pc' >= o) s

let sort_in_post_order t l =
List.sort ~cmp:(fun a b -> compare (block_order t a) (block_order t b)) l
List.sort ~cmp:(fun a b -> compare (block_order t b) (block_order t a)) l

let blocks_in_reverse_post_order g = g.reverse_post_order

(*
Expand Down
2 changes: 2 additions & 0 deletions compiler/lib/structure.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ val is_loop_header : t -> Addr.t -> bool

val sort_in_post_order : t -> Addr.t list -> Addr.t list

val blocks_in_reverse_post_order : t -> Code.Addr.t list

val get_nodes : t -> Addr.Set.t
Loading

0 comments on commit 058036f

Please sign in to comment.