Skip to content

Commit

Permalink
flambda-backend: Allow forceful crossing of portability and contention (
Browse files Browse the repository at this point in the history
#2725)

* Add basic tests

* Add -allow-illegal-crossing flag

* Implement for records, variants, and private types, and update tests

* Fix bug causing types to always cross

* Add more tests

* Fix types with abbrev and manifest

* Remove comment about module signatures

* Add more tests for illegal crossing in signatures

* Add tests demonstrating that values can't cross illegally

* Remove no-op annotations

* Treat private types as non-nominative

* Print annotations when there is illegal crossing

* Remove incorrect test

* Add test demonstrating incorrect inference for type parameter

* Fix test numbering

* Fix inference test

* Add cr to remove type_has_illegal_crossings

* Update note about printing jkinds

* Add comment for printing case C1.3

* Fixed incorrect type_has_illegal_crossings value

* Fix test for inferring 'a

* Rename allow-illegal-crossing.ml to allow_illegal_crossing.ml

* Add tests for mode crossing
  • Loading branch information
liam923 authored Jul 10, 2024
1 parent c8a69a3 commit 6169046
Show file tree
Hide file tree
Showing 18 changed files with 1,172 additions and 6 deletions.
11 changes: 11 additions & 0 deletions driver/main_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ in
\ allows a set of extensions, and every successive universe includes \n\
\ the previous one."

let mk_allow_illegal_crossing f =
"-allow-illegal-crossing", Arg.Unit f,
"Type declarations will not be checked along the portability or contention axes"

let mk_dump_dir f =
"-dump-dir", Arg.String f,
"<dir> dump output like -dlambda into <dir>/<target>.dump"
Expand Down Expand Up @@ -920,6 +924,7 @@ module type Common_options = sig
val _extension : string -> unit
val _no_extension : string -> unit
val _extension_universe : string -> unit
val _allow_illegal_crossing : unit -> unit
val _noassert : unit -> unit
val _nolabels : unit -> unit
val _nostdlib : unit -> unit
Expand Down Expand Up @@ -1201,6 +1206,7 @@ struct
mk_extension F._extension;
mk_no_extension F._no_extension;
mk_extension_universe F._extension_universe;
mk_allow_illegal_crossing F._allow_illegal_crossing;
mk_for_pack_byt F._for_pack;
mk_g_byt F._g;
mk_no_g F._no_g;
Expand Down Expand Up @@ -1328,6 +1334,7 @@ struct
mk_extension F._extension;
mk_no_extension F._no_extension;
mk_extension_universe F._extension_universe;
mk_allow_illegal_crossing F._allow_illegal_crossing;
mk_noassert F._noassert;
mk_noinit F._noinit;
mk_nolabels F._nolabels;
Expand Down Expand Up @@ -1421,6 +1428,7 @@ struct
mk_extension F._extension;
mk_no_extension F._no_extension;
mk_extension_universe F._extension_universe;
mk_allow_illegal_crossing F._allow_illegal_crossing;
mk_for_pack_opt F._for_pack;
mk_g_opt F._g;
mk_no_g F._no_g;
Expand Down Expand Up @@ -1607,6 +1615,7 @@ module Make_opttop_options (F : Opttop_options) = struct
mk_extension F._extension;
mk_no_extension F._no_extension;
mk_extension_universe F._extension_universe;
mk_allow_illegal_crossing F._allow_illegal_crossing;
mk_no_float_const_prop F._no_float_const_prop;
mk_noassert F._noassert;
mk_noinit F._noinit;
Expand Down Expand Up @@ -1714,6 +1723,7 @@ struct
mk_extension F._extension;
mk_no_extension F._no_extension;
mk_extension_universe F._extension_universe;
mk_allow_illegal_crossing F._allow_illegal_crossing;
mk_noassert F._noassert;
mk_nolabels F._nolabels;
mk_nostdlib F._nostdlib;
Expand Down Expand Up @@ -1825,6 +1835,7 @@ module Default = struct
let _no_extension s = Language_extension.(disable_of_string_exn s)
let _extension_universe s =
Language_extension.(set_universe_and_enable_all_of_string_exn s)
let _allow_illegal_crossing = set Clflags.allow_illegal_crossing
let _noassert = set noassert
let _nolabels = set classic
let _nostdlib = set no_std_include
Expand Down
1 change: 1 addition & 0 deletions driver/main_args.mli
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module type Common_options = sig
val _extension : string -> unit
val _no_extension : string -> unit
val _extension_universe : string -> unit
val _allow_illegal_crossing : unit -> unit
val _noassert : unit -> unit
val _nolabels : unit -> unit
val _nostdlib : unit -> unit
Expand Down
Loading

0 comments on commit 6169046

Please sign in to comment.