Skip to content

Commit 6169046

Browse files
authored
flambda-backend: Allow forceful crossing of portability and contention (#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
1 parent c8a69a3 commit 6169046

File tree

18 files changed

+1172
-6
lines changed

18 files changed

+1172
-6
lines changed

driver/main_args.ml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ in
728728
\ allows a set of extensions, and every successive universe includes \n\
729729
\ the previous one."
730730

731+
let mk_allow_illegal_crossing f =
732+
"-allow-illegal-crossing", Arg.Unit f,
733+
"Type declarations will not be checked along the portability or contention axes"
734+
731735
let mk_dump_dir f =
732736
"-dump-dir", Arg.String f,
733737
"<dir> dump output like -dlambda into <dir>/<target>.dump"
@@ -920,6 +924,7 @@ module type Common_options = sig
920924
val _extension : string -> unit
921925
val _no_extension : string -> unit
922926
val _extension_universe : string -> unit
927+
val _allow_illegal_crossing : unit -> unit
923928
val _noassert : unit -> unit
924929
val _nolabels : unit -> unit
925930
val _nostdlib : unit -> unit
@@ -1201,6 +1206,7 @@ struct
12011206
mk_extension F._extension;
12021207
mk_no_extension F._no_extension;
12031208
mk_extension_universe F._extension_universe;
1209+
mk_allow_illegal_crossing F._allow_illegal_crossing;
12041210
mk_for_pack_byt F._for_pack;
12051211
mk_g_byt F._g;
12061212
mk_no_g F._no_g;
@@ -1328,6 +1334,7 @@ struct
13281334
mk_extension F._extension;
13291335
mk_no_extension F._no_extension;
13301336
mk_extension_universe F._extension_universe;
1337+
mk_allow_illegal_crossing F._allow_illegal_crossing;
13311338
mk_noassert F._noassert;
13321339
mk_noinit F._noinit;
13331340
mk_nolabels F._nolabels;
@@ -1421,6 +1428,7 @@ struct
14211428
mk_extension F._extension;
14221429
mk_no_extension F._no_extension;
14231430
mk_extension_universe F._extension_universe;
1431+
mk_allow_illegal_crossing F._allow_illegal_crossing;
14241432
mk_for_pack_opt F._for_pack;
14251433
mk_g_opt F._g;
14261434
mk_no_g F._no_g;
@@ -1607,6 +1615,7 @@ module Make_opttop_options (F : Opttop_options) = struct
16071615
mk_extension F._extension;
16081616
mk_no_extension F._no_extension;
16091617
mk_extension_universe F._extension_universe;
1618+
mk_allow_illegal_crossing F._allow_illegal_crossing;
16101619
mk_no_float_const_prop F._no_float_const_prop;
16111620
mk_noassert F._noassert;
16121621
mk_noinit F._noinit;
@@ -1714,6 +1723,7 @@ struct
17141723
mk_extension F._extension;
17151724
mk_no_extension F._no_extension;
17161725
mk_extension_universe F._extension_universe;
1726+
mk_allow_illegal_crossing F._allow_illegal_crossing;
17171727
mk_noassert F._noassert;
17181728
mk_nolabels F._nolabels;
17191729
mk_nostdlib F._nostdlib;
@@ -1825,6 +1835,7 @@ module Default = struct
18251835
let _no_extension s = Language_extension.(disable_of_string_exn s)
18261836
let _extension_universe s =
18271837
Language_extension.(set_universe_and_enable_all_of_string_exn s)
1838+
let _allow_illegal_crossing = set Clflags.allow_illegal_crossing
18281839
let _noassert = set noassert
18291840
let _nolabels = set classic
18301841
let _nostdlib = set no_std_include

driver/main_args.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module type Common_options = sig
3434
val _extension : string -> unit
3535
val _no_extension : string -> unit
3636
val _extension_universe : string -> unit
37+
val _allow_illegal_crossing : unit -> unit
3738
val _noassert : unit -> unit
3839
val _nolabels : unit -> unit
3940
val _nostdlib : unit -> unit

0 commit comments

Comments
 (0)