From 966e54a71af0b5988bf355f3dfa8642eaff459c5 Mon Sep 17 00:00:00 2001 From: Vincent Laviron Date: Thu, 31 Oct 2024 13:46:29 +0100 Subject: [PATCH] Add constructor for Null type --- middle_end/flambda2/types/grammar/type_grammar.ml | 3 +++ middle_end/flambda2/types/grammar/type_grammar.mli | 2 ++ 2 files changed, 5 insertions(+) diff --git a/middle_end/flambda2/types/grammar/type_grammar.ml b/middle_end/flambda2/types/grammar/type_grammar.ml index ab2edd4d224..c2cbd6e2551 100644 --- a/middle_end/flambda2/types/grammar/type_grammar.ml +++ b/middle_end/flambda2/types/grammar/type_grammar.ml @@ -3194,6 +3194,9 @@ let box_vec128 (t : t) alloc_mode : t = | Naked_int32 _ | Naked_int64 _ | Naked_nativeint _ | Rec_info _ | Region _ -> Misc.fatal_errorf "Type of wrong kind for [box_vec128]: %a" print t +let null : t = + Value (TD.create { non_null = Bottom; is_null = Maybe_null }) + let this_tagged_immediate imm : t = Value (TD.create_equals (Simple.const (RWC.tagged_immediate imm))) diff --git a/middle_end/flambda2/types/grammar/type_grammar.mli b/middle_end/flambda2/types/grammar/type_grammar.mli index dd3973a9616..3ebdb7c0b94 100644 --- a/middle_end/flambda2/types/grammar/type_grammar.mli +++ b/middle_end/flambda2/types/grammar/type_grammar.mli @@ -233,6 +233,8 @@ val any_region : t val any_rec_info : t +val null : t + val this_tagged_immediate : Targetint_31_63.t -> t val this_rec_info : Rec_info_expr.t -> t