diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-07-06 14:32:14 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-07-06 16:49:59 +0100 |
commit | aeaf3df2d745eab8b7fec37cdff44deadba6fed3 (patch) | |
tree | cc05720f9b83a7491c23987d540a88f64f06c433 | |
parent | f857f0741515b9ebf186beb38fe64448de355817 (diff) | |
download | haskell-aeaf3df2d745eab8b7fec37cdff44deadba6fed3.tar.gz |
put back the newtype around Label
Having all BlockIds print as integers was a pain for debugging.
-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 |