Skip to content

Commit d030554

Browse files
committed
Typechecking for local allocations (#21)
Adds allocation modes on arrow types, including mode checking for complex applications (reordered and omitted labelled arguments). Adds tests for values that are never locally allocated. Includes a bugfix: let[@stack] at module level was incorrectly accepted. (Contains bootstrap)
1 parent 9ee2332 commit d030554

File tree

20 files changed

+851
-133
lines changed

20 files changed

+851
-133
lines changed

boot/ocamlc

10.6 KB
Binary file not shown.

boot/ocamllex

16 Bytes
Binary file not shown.

lambda/translcore.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,9 @@ and transl_let ~scopes ?(in_structure=false) ?(mode=Alloc_heap) rec_flag
929929
let mk_body = transl rem in
930930
fun body ->
931931
Matching.for_let ~scopes pat.pat_loc lam pat (mk_body body)
932-
in fun body -> maybe_region mode bound_modes (transl pat_expr_list body)
932+
in
933+
let f = transl pat_expr_list in
934+
fun body -> maybe_region mode bound_modes (f body)
933935
| Recursive ->
934936
let idlist =
935937
List.map

ocamldoc/odoc_value.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ let update_value_parameters_text v =
7373
let parameter_list_from_arrows typ =
7474
let rec iter t =
7575
match t.Types.desc with
76-
Types.Tarrow (l, t1, t2, _) ->
76+
Types.Tarrow ((l,_,_), t1, t2, _) ->
7777
(l, t1) :: (iter t2)
7878
| Types.Tlink texp
7979
| Types.Tsubst texp ->

runtime/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
../Makefile.config_if_required
3636
../Makefile.common Makefile
3737
(glob_files caml/*.h)
38+
(glob_files caml/*.tbl)
3839
; matches the line structure of files in Makefile/BYTECODE_C_SOURCES
3940
interp.c misc.c stacks.c fix_code.c startup_aux.c startup_byt.c freelist.c
4041
major_gc.c

0 commit comments

Comments
 (0)