diff options
| -rw-r--r-- | compiler/cmm/BlockId.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/cmm/BlockId.hs b/compiler/cmm/BlockId.hs index 4aedcb7074..95293c850b 100644 --- a/compiler/cmm/BlockId.hs +++ b/compiler/cmm/BlockId.hs @@ -15,7 +15,7 @@ import Outputable import Unique import Compiler.Hoopl as Hoopl hiding (Unique) -import Compiler.Hoopl.Internals (uniqueToLbl) +import Compiler.Hoopl.Internals (uniqueToLbl, lblToUnique) ---------------------------------------------------------------- --- Block Ids, their environments, and their sets @@ -31,6 +31,12 @@ compilation unit in which it appears. type BlockId = Hoopl.Label +instance Uniquable BlockId where + getUnique label = getUnique (lblToUnique label) + +instance Outputable BlockId where + ppr label = ppr (getUnique label) + mkBlockId :: Unique -> BlockId mkBlockId unique = uniqueToLbl $ intToUnique $ getKey unique |
