Skip to content

Commit a74ffbb

Browse files
committed
Merge pull request #99 from ocaml-wasm/clean-up
Clean up: remove unused or duplicated code
2 parents 5105f11 + f4f188a commit a74ffbb

27 files changed

+296
-3717
lines changed

.github/workflows/merge.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Daily Merge with ocsigen/js_of_ocaml
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Executes daily at midnight UTC
6+
workflow_dispatch: # Allows manual triggering of the workflow
7+
push:
8+
9+
jobs:
10+
merge:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout this repository
15+
uses: actions/checkout@v3
16+
with:
17+
ref: main
18+
fetch-depth: 1000
19+
20+
- name: Fetch js_of_ocaml master
21+
run: git fetch https://github.com/ocsigen/js_of_ocaml.git master
22+
23+
- name: Merge js_of_ocaml master into current repository
24+
run: git merge FETCH_HEAD
25+
26+
- name: Push merged changes to 'jsoo-merged' branch
27+
run: |
28+
if git show-ref --verify --quiet refs/heads/jsoo-merged; then
29+
git branch -D jsoo-merged
30+
fi
31+
git checkout -b jsoo-merged
32+
git push --force origin jsoo-merged

compiler/lib/generate.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ and compile_block_no_loop st queue (pc : Addr.t) ~fall_through scope_stack =
16421642
| true -> never, [ J.Labelled_statement (l, (J.Block inner, J.N)), J.N ] @ code
16431643
| false -> never, inner @ code)
16441644
in
1645-
let never_after, after = loop ~scope_stack ~fall_through (List.rev new_scopes) in
1645+
let never_after, after = loop ~scope_stack ~fall_through new_scopes in
16461646
never_after, seq @ after
16471647

16481648
and compile_decision_tree kind st scope_stack loc cx dtree ~fall_through =

compiler/lib/structure.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ let is_loop_header g pc =
147147
Addr.Set.exists (fun pc' -> Hashtbl.find g.block_order pc' >= o) s
148148

149149
let sort_in_post_order t l =
150-
List.sort ~cmp:(fun a b -> compare (block_order t a) (block_order t b)) l
150+
List.sort ~cmp:(fun a b -> compare (block_order t b) (block_order t a)) l
151+
152+
let blocks_in_reverse_post_order g = g.reverse_post_order
151153

152154
(*
153155

compiler/lib/structure.mli

+2
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ val is_loop_header : t -> Addr.t -> bool
2121

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

24+
val blocks_in_reverse_post_order : t -> Code.Addr.t list
25+
2426
val get_nodes : t -> Addr.Set.t

0 commit comments

Comments
 (0)