summaryrefslogtreecommitdiff
path: root/libraries/ghc-heap
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-01-12 09:43:23 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-02 12:24:47 -0500
commitddbdec4128f0e6760c8c7a19344f2f2a7a3314bf (patch)
tree2fdd7c673733923895d512a3c00d926fc76764f5 /libraries/ghc-heap
parent7d910fd812c7c29f59fac7f1991b3b057460a058 (diff)
downloadhaskell-ddbdec4128f0e6760c8c7a19344f2f2a7a3314bf.tar.gz
Add missing instances to ghc-heap types
These instances are useful so that a `GenClosure` form `ghc-heap` can be used as a key in a `Map`. Therefore the order itself is not important but just the fact that there is one.
Diffstat (limited to 'libraries/ghc-heap')
-rw-r--r--libraries/ghc-heap/GHC/Exts/Heap/Closures.hs8
-rw-r--r--libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs8
2 files changed, 8 insertions, 8 deletions
diff --git a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
index 3c5d5f1c32..1a6a9371d4 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
+++ b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
@@ -368,7 +368,7 @@ data PrimType
| PAddr
| PFloat
| PDouble
- deriving (Eq, Show, Generic)
+ deriving (Eq, Show, Generic, Ord)
data WhatNext
= ThreadRunGHC
@@ -376,7 +376,7 @@ data WhatNext
| ThreadKilled
| ThreadComplete
| WhatNextUnknownValue Word16 -- ^ Please report this as a bug
- deriving (Eq, Show, Generic)
+ deriving (Eq, Show, Generic, Ord)
data WhyBlocked
= NotBlocked
@@ -394,7 +394,7 @@ data WhyBlocked
| ThreadMigrating
| BlockedOnIOCompletion
| WhyBlockedUnknownValue Word16 -- ^ Please report this as a bug
- deriving (Eq, Show, Generic)
+ deriving (Eq, Show, Generic, Ord)
data TsoFlags
= TsoLocked
@@ -405,7 +405,7 @@ data TsoFlags
| TsoSqueezed
| TsoAllocLimit
| TsoFlagsUnknownValue Word32 -- ^ Please report this as a bug
- deriving (Eq, Show, Generic)
+ deriving (Eq, Show, Generic, Ord)
-- | For generic code, this function returns all referenced closures.
allClosures :: GenClosure b -> [b]
diff --git a/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs b/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs
index b6915b374d..579d29098c 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs
+++ b/libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs
@@ -11,7 +11,7 @@ import GHC.Generics
-- for more details on this data structure.
data StgTSOProfInfo = StgTSOProfInfo {
cccs :: Maybe CostCentreStack
-} deriving (Show, Generic)
+} deriving (Show, Generic, Eq, Ord)
-- | This is a somewhat faithful representation of CostCentreStack. See
-- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h>
@@ -29,7 +29,7 @@ data CostCentreStack = CostCentreStack {
ccs_mem_alloc :: Word64,
ccs_inherited_alloc :: Word64,
ccs_inherited_ticks :: Word
-} deriving (Show, Generic, Eq)
+} deriving (Show, Generic, Eq, Ord)
-- | This is a somewhat faithful representation of CostCentre. See
-- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h>
@@ -43,7 +43,7 @@ data CostCentre = CostCentre {
cc_time_ticks :: Word,
cc_is_caf :: Bool,
cc_link :: Maybe CostCentre
-} deriving (Show, Generic, Eq)
+} deriving (Show, Generic, Eq, Ord)
-- | This is a somewhat faithful representation of IndexTable. See
-- <https://gitlab.haskell.org/ghc/ghc/blob/master/includes/rts/prof/CCS.h>
@@ -53,4 +53,4 @@ data IndexTable = IndexTable {
it_ccs :: Maybe CostCentreStack,
it_next :: Maybe IndexTable,
it_back_edge :: Bool
-} deriving (Show, Generic, Eq)
+} deriving (Show, Generic, Eq, Ord)