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 committed Oct 10, 2024
2 parents 5105f11 + f4f188a commit 67cd85b
Show file tree
Hide file tree
Showing 27 changed files with 296 additions and 3,717 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Daily Merge with ocsigen/js_of_ocaml

on:
schedule:
- cron: '0 0 * * *' # Executes daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
push:

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Checkout this repository
uses: actions/checkout@v3
with:
ref: main
fetch-depth:1000

- name: Fetch js_of_ocaml master
run: git fetch https://github.com/ocsigen/js_of_ocaml.git master

- name: Merge js_of_ocaml master into current repository
run: git merge upstream/main

- name: Push merged changes to 'jsoo-merged' branch
run: |
if git show-ref --verify --quiet refs/heads/jsoo-merged; then
git branch -D jsoo-merged
fi
git checkout -b jsoo-merged
git push --force origin jsoo-merged
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 67cd85b

Please sign in to comment.