diff options
author | Pierre Chambart <pierre.chambart@ocamlpro.com> | 2018-01-19 17:25:06 +0100 |
---|---|---|
committer | Pierre Chambart <pierre.chambart@ocamlpro.com> | 2019-02-11 17:16:44 +0100 |
commit | f8058ac367a44bbb275e02ce4374d68ceac420f8 (patch) | |
tree | ee3c04a00897022b9ece6fd0f4a08f23920358d2 /bytecomp | |
parent | 38433518767009c576dd8a2f40f2e2d4692c5b6e (diff) | |
download | ocaml-f8058ac367a44bbb275e02ce4374d68ceac420f8.tar.gz |
Remove lambda version of Semantics_of_primitives
Diffstat (limited to 'bytecomp')
-rw-r--r-- | bytecomp/semantics_of_primitives.ml | 140 | ||||
-rw-r--r-- | bytecomp/semantics_of_primitives.mli | 2 |
2 files changed, 0 insertions, 142 deletions
diff --git a/bytecomp/semantics_of_primitives.ml b/bytecomp/semantics_of_primitives.ml index 91a9dcf093..95084ea218 100644 --- a/bytecomp/semantics_of_primitives.ml +++ b/bytecomp/semantics_of_primitives.ml @@ -19,146 +19,6 @@ type effects = No_effects | Only_generative_effects | Arbitrary_effects type coeffects = No_coeffects | Has_coeffects -let for_primitive (prim : Lambda.primitive) = - match prim with - | Pignore | Pidentity -> - No_effects, No_coeffects - | Pbytes_to_string | Pbytes_of_string -> - No_effects, No_coeffects - | Pmakeblock _ - | Pmakearray (_, Mutable) -> Only_generative_effects, No_coeffects - | Pmakearray (_, Immutable) -> No_effects, No_coeffects - | Pduparray (_, Immutable) -> - No_effects, No_coeffects (* Pduparray (_, Immutable) is allowed only on - immutable arrays. *) - | Pduparray (_, Mutable) | Pduprecord _ -> - Only_generative_effects, Has_coeffects - | Pccall { prim_name = - ( "caml_format_float" | "caml_format_int" | "caml_int32_format" - | "caml_nativeint_format" | "caml_int64_format" ) } -> - No_effects, No_coeffects - | Pccall _ -> Arbitrary_effects, Has_coeffects - | Praise _ -> Arbitrary_effects, No_coeffects - | Pnot - | Pnegint - | Paddint - | Psubint - | Pmulint - | Pandint - | Porint - | Pxorint - | Plslint - | Plsrint - | Pasrint - | Pintcomp _ -> No_effects, No_coeffects - | Pdivbint { is_safe = Unsafe } - | Pmodbint { is_safe = Unsafe } - | Pdivint Unsafe - | Pmodint Unsafe -> - No_effects, No_coeffects (* Will not raise [Division_by_zero]. *) - | Pdivbint { is_safe = Safe } - | Pmodbint { is_safe = Safe } - | Pdivint Safe - | Pmodint Safe -> - Arbitrary_effects, No_coeffects - | Poffsetint _ -> No_effects, No_coeffects - | Poffsetref _ -> Arbitrary_effects, Has_coeffects - | Pintoffloat - | Pfloatofint - | Pnegfloat - | Pabsfloat - | Paddfloat - | Psubfloat - | Pmulfloat - | Pdivfloat - | Pfloatcomp _ -> No_effects, No_coeffects - | Pstringlength | Pbyteslength - | Parraylength _ -> - No_effects, Has_coeffects (* That old chestnut: [Obj.truncate]. *) - | Pisint - | Pisout - | Pbintofint _ - | Pintofbint _ - | Pcvtbint _ - | Pnegbint _ - | Paddbint _ - | Psubbint _ - | Pmulbint _ - | Pandbint _ - | Porbint _ - | Pxorbint _ - | Plslbint _ - | Plsrbint _ - | Pasrbint _ - | Pbintcomp _ -> No_effects, No_coeffects - | Pbigarraydim _ -> - No_effects, Has_coeffects (* Some people resize bigarrays in place. *) - | Pfield _ - | Pfield_computed - | Pfloatfield _ - | Pgetglobal _ - | Parrayrefu _ - | Pstringrefu - | Pbytesrefu - | Pstring_load_16 true - | Pstring_load_32 true - | Pstring_load_64 true - | Pbytes_load_16 true - | Pbytes_load_32 true - | Pbytes_load_64 true - | Pbigarrayref (true, _, _, _) - | Pbigstring_load_16 true - | Pbigstring_load_32 true - | Pbigstring_load_64 true -> - No_effects, Has_coeffects - | Parrayrefs _ - | Pstringrefs - | Pbytesrefs - | Pstring_load_16 false - | Pstring_load_32 false - | Pstring_load_64 false - | Pbytes_load_16 false - | Pbytes_load_32 false - | Pbytes_load_64 false - | Pbigarrayref (false, _, _, _) - | Pbigstring_load_16 false - | Pbigstring_load_32 false - | Pbigstring_load_64 false -> - (* May trigger a bounds check exception. *) - Arbitrary_effects, Has_coeffects - | Psetfield _ - | Psetfield_computed _ - | Psetfloatfield _ - | Psetglobal _ - | Parraysetu _ - | Parraysets _ - | Pbytessetu - | Pbytessets - | Pbytes_set_16 _ - | Pbytes_set_32 _ - | Pbytes_set_64 _ - | Pbigarrayset _ - | Pbigstring_set_16 _ - | Pbigstring_set_32 _ - | Pbigstring_set_64 _ -> - (* Whether or not some of these are "unsafe" is irrelevant; they always - have an effect. *) - Arbitrary_effects, No_coeffects - | Pctconst _ -> No_effects, No_coeffects - | Pbswap16 - | Pbbswap _ -> No_effects, No_coeffects - | Pint_as_pointer -> No_effects, No_coeffects - | Popaque -> Arbitrary_effects, Has_coeffects - | Prevapply - | Pdirapply -> - (* Removed by [Simplif], but there is no reason to prevent using - the current analysis function before/during Simplif. *) - Arbitrary_effects, Has_coeffects - | Psequand - | Psequor -> - (* Removed by [Closure_conversion] in the flambda pipeline. *) - No_effects, No_coeffects - let for_clambda_primitive (prim : Clambda_primitives.primitive) = match prim with | Pmakeblock _ diff --git a/bytecomp/semantics_of_primitives.mli b/bytecomp/semantics_of_primitives.mli index 91ee805579..e9bb236130 100644 --- a/bytecomp/semantics_of_primitives.mli +++ b/bytecomp/semantics_of_primitives.mli @@ -60,8 +60,6 @@ type coeffects = No_coeffects | Has_coeffects the (non-)(co)effectfulness of the arguments in a primitive application. To determine whether such an application is (co)effectful, the arguments must also be analysed. *) -val for_primitive: Lambda.primitive -> effects * coeffects - val for_clambda_primitive: Clambda_primitives.primitive -> effects * coeffects type return_type = |