summaryrefslogtreecommitdiff
path: root/compiler/GHC/Builtin
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2020-11-18 11:56:30 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2021-03-03 19:09:34 +0000
commit9087899e36015bcc0142700a89c368bbc3da4b81 (patch)
treefeefe3a6b8326358543e4e053ad640919351da7a /compiler/GHC/Builtin
parenta7aac008f69ca48e5ab3d4186fdcb3214c6e1463 (diff)
downloadhaskell-9087899e36015bcc0142700a89c368bbc3da4b81.tar.gz
Add whereFrom and whereFrom# primop
The `whereFrom` function provides a Haskell interface for using the information created by `-finfo-table-map`. Given a Haskell value, the info table address will be passed to the `lookupIPE` function in order to attempt to find the source location information for that particular closure. At the moment it's not possible to distinguish the absense of the map and a failed lookup.
Diffstat (limited to 'compiler/GHC/Builtin')
-rw-r--r--compiler/GHC/Builtin/primops.txt.pp11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp
index 8389de098c..27b7f55132 100644
--- a/compiler/GHC/Builtin/primops.txt.pp
+++ b/compiler/GHC/Builtin/primops.txt.pp
@@ -3245,6 +3245,17 @@ primop ClearCCSOp "clearCCS#" GenPrimOp
out_of_line = True
------------------------------------------------------------------------
+section "Info Table Origin"
+------------------------------------------------------------------------
+primop WhereFromOp "whereFrom#" GenPrimOp
+ a -> State# s -> (# State# s, Addr# #)
+ { Returns the {\tt InfoProvEnt } for the info table of the given object
+ (value is {\tt NULL} if the table does not exist or there is no information
+ about the closure).}
+ with
+ out_of_line = True
+
+------------------------------------------------------------------------
section "Etc"
{Miscellaneous built-ins}
------------------------------------------------------------------------