summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmExtCode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen/StgCmmExtCode.hs')
-rw-r--r--compiler/codeGen/StgCmmExtCode.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/codeGen/StgCmmExtCode.hs b/compiler/codeGen/StgCmmExtCode.hs
index f3bb6ee5b8..f12ada242b 100644
--- a/compiler/codeGen/StgCmmExtCode.hs
+++ b/compiler/codeGen/StgCmmExtCode.hs
@@ -43,13 +43,13 @@ import Cmm
import CLabel
import MkGraph
--- import BasicTypes
import BlockId
import DynFlags
import FastString
import Module
import UniqFM
import Unique
+import UniqSupply
import Control.Monad (liftM, ap)
@@ -90,6 +90,12 @@ instance Applicative CmmParse where
instance Monad CmmParse where
(>>=) = thenExtFC
+instance MonadUnique CmmParse where
+ getUniqueSupplyM = code getUniqueSupplyM
+ getUniqueM = EC $ \_ _ decls -> do
+ u <- getUniqueM
+ return (decls, u)
+
instance HasDynFlags CmmParse where
getDynFlags = EC (\_ _ d -> do dflags <- getDynFlags
return (d, dflags))
@@ -155,9 +161,6 @@ newLabel name = do
addLabel name (mkBlockId u)
return (mkBlockId u)
-newBlockId :: CmmParse BlockId
-newBlockId = code F.newLabelC
-
-- | Add add a local function to the environment.
newFunctionName
:: FastString -- ^ name of the function