Skip to content

Commit

Permalink
Compiler: nativeInt is always 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo authored and OlivierNicole committed Sep 30, 2024
1 parent 87f2119 commit 99c46f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions compiler/lib/code.ml
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ type constant =
| NativeString of Native_string.t
| Float of float
| Float_array of float array
| Int of int32
| Int32 of int32
| Int64 of int64
| NativeInt of nativeint
| Int of Int32.t
| Int32 of Int32.t
| Int64 of Int64.t
| NativeInt of Int32.t (* Native int are 32bit on all known backend *)
| Tuple of int * constant array * array_or_not

module Constant = struct
Expand All @@ -311,7 +311,7 @@ module Constant = struct
!same
| Int a, Int b | Int32 a, Int32 b -> Some (Int32.equal a b)
| Int64 a, Int64 b -> Some (Int64.equal a b)
| NativeInt a, NativeInt b -> Some (Nativeint.equal a b)
| NativeInt a, NativeInt b -> Some (Int32.equal a b)
| Float_array a, Float_array b -> Some (Array.equal Float.ieee_equal a b)
| Float a, Float b -> Some (Float.ieee_equal a b)
| String _, NativeString _ | NativeString _, String _ -> None
Expand Down Expand Up @@ -459,7 +459,7 @@ module Print = struct
| Int i -> Format.fprintf f "%ld" i
| Int32 i -> Format.fprintf f "%ldl" i
| Int64 i -> Format.fprintf f "%LdL" i
| NativeInt i -> Format.fprintf f "%ndn" i
| NativeInt i -> Format.fprintf f "%ldn" i
| Tuple (tag, a, _) -> (
Format.fprintf f "<%d>" tag;
match Array.length a with
Expand Down
8 changes: 4 additions & 4 deletions compiler/lib/code.mli
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ type constant =
| NativeString of Native_string.t
| Float of float
| Float_array of float array
| Int of int32
| Int32 of int32 (** Only produced when compiling to WebAssembly. *)
| Int64 of int64
| NativeInt of nativeint (** Only produced when compiling to WebAssembly. *)
| Int of Int32.t
| Int32 of Int32.t (** Only produced when compiling to WebAssembly. *)
| Int64 of Int64.t
| NativeInt of Int32.t (** Only produced when compiling to WebAssembly. *)
| Tuple of int * constant array * array_or_not

module Constant : sig
Expand Down

0 comments on commit 99c46f0

Please sign in to comment.