[commit: ghc] master: put back the newtype around Label (aeaf3df)
Simon Marlow
marlowsd at gmail.com
Fri Jul 6 17:50:26 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/aeaf3df2d745eab8b7fec37cdff44deadba6fed3
>---------------------------------------------------------------
commit aeaf3df2d745eab8b7fec37cdff44deadba6fed3
Author: Simon Marlow <marlowsd at gmail.com>
Date: Fri Jul 6 14:32:14 2012 +0100
put back the newtype around Label
Having all BlockIds print as integers was a pain for debugging.
>---------------------------------------------------------------
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 4aedcb7..95293c8 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
More information about the Cvs-ghc
mailing list