diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-04-16 09:36:52 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-04-16 09:44:47 -0400 |
commit | 4a5cd4be1a5055152d7bf2e4ab22ba665a5b0772 (patch) | |
tree | ce522634f94a1d6fd1ea35b9fb7e657d20efbe07 | |
parent | 926e0a7174aa0e6f4799e536786e8bc508b22f05 (diff) | |
download | haskell-wip/T19629.tar.gz |
primops: Undeprecate addr2Int# and int2Addr#wip/T19629
addr2Int# and int2Addr# were marked as deprecated with the introduction
of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f)
due to its use of tagged integers. However, this backend has long
vanished and `base` has all along been using `addr2Int#` in the Show
instance for Ptr.
While it's unlikely that we will have another backend which has tagged
integers, we may indeed support platforms which have tagged pointers.
Consequently we undeprecate the operations but warn the user that the
operations may not be portable.
-rw-r--r-- | compiler/GHC/Builtin/primops.txt.pp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp index a00f3f8215..0f1012ea40 100644 --- a/compiler/GHC/Builtin/primops.txt.pp +++ b/compiler/GHC/Builtin/primops.txt.pp @@ -1997,13 +1997,13 @@ primop AddrRemOp "remAddr#" GenPrimOp Addr# -> Int# -> Int# {Return the remainder when the {\tt Addr\#} arg, treated like an {\tt Int\#}, is divided by the {\tt Int\#} arg.} primop AddrToIntOp "addr2Int#" GenPrimOp Addr# -> Int# - {Coerce directly from address to int.} + {Coerce directly from address to int. Users are discouraged from using + this operation as it makes little sense on platforms with tagged pointers.} with code_size = 0 - deprecated_msg = { This operation is strongly deprecated. } primop IntToAddrOp "int2Addr#" GenPrimOp Int# -> Addr# - {Coerce directly from int to address.} + {Coerce directly from int to address. Users are discouraged from using + this operation as it makes little sense on platforms with tagged pointers.} with code_size = 0 - deprecated_msg = { This operation is strongly deprecated. } primop AddrGtOp "gtAddr#" Compare Addr# -> Addr# -> Int# primop AddrGeOp "geAddr#" Compare Addr# -> Addr# -> Int# |