diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-11-29 14:44:19 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-29 14:44:20 -0500 |
commit | 4d4e7a512aa4ecbb5811cccc1dab335379e63efa (patch) | |
tree | 38aaf168992d569f8ff29e21286873a017562100 /compiler/codeGen/StgCmmExtCode.hs | |
parent | 68450878b44ddb63beb3c589cd60d43461900986 (diff) | |
download | haskell-4d4e7a512aa4ecbb5811cccc1dab335379e63efa.tar.gz |
Use newBlockId instead of newLabelC
This seems like a clearer name and the fewer functions that
one needs to remember, the better.
Test Plan: validate
Reviewers: austin, simonmar, michalt
Reviewed By: simonmar, michalt
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2735
Diffstat (limited to 'compiler/codeGen/StgCmmExtCode.hs')
-rw-r--r-- | compiler/codeGen/StgCmmExtCode.hs | 11 |
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 |