Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

10 changed files:

Changes:

  • compiler/GHC/CmmToLlvm/Base.hs
    ... ... @@ -318,7 +318,7 @@ instance DSM.MonadGetUnique LlvmM where
    318 318
         tag <- getEnv envTag
    
    319 319
         liftUDSMT $! do
    
    320 320
           uq <- DSM.getUniqueM
    
    321
    -      return (newTagUniqueGrimly uq tag)
    
    321
    +      return (newTagUniqueGrimily uq tag)
    
    322 322
     
    
    323 323
     -- | Lifting of IO actions. Not exported, as we want to encapsulate IO.
    
    324 324
     liftIO :: IO a -> LlvmM a
    

  • compiler/GHC/Core/Opt/Monad.hs
    ... ... @@ -175,11 +175,11 @@ instance MonadPlus CoreM
    175 175
     instance MonadUnique CoreM where
    
    176 176
         getUniqueSupplyM = do
    
    177 177
             tag <- read cr_uniq_tag
    
    178
    -        liftIO $! mkSplitUniqSupplyGrimly tag
    
    178
    +        liftIO $! mkSplitUniqSupplyGrimily tag
    
    179 179
     
    
    180 180
         getUniqueM = do
    
    181 181
             tag <- read cr_uniq_tag
    
    182
    -        liftIO $! uniqFromTagGrimly tag
    
    182
    +        liftIO $! uniqFromTagGrimily tag
    
    183 183
     
    
    184 184
     runCoreM :: HscEnv
    
    185 185
              -> RuleBase
    

  • compiler/GHC/HsToCore/Foreign/JavaScript.hs
    ... ... @@ -144,7 +144,7 @@ mkFExportJSBits platform c_nm maybe_target arg_htys res_hty is_IO_res_ty _cconv
    144 144
                    | otherwise       = unpackHObj res_hty
    
    145 145
     
    
    146 146
       header_bits = maybe mempty idTag maybe_target
    
    147
    -  idTag i = let (tag, u) = unpkUniqueGrimly (getUnique i)
    
    147
    +  idTag i = let (tag, u) = unpkUniqueGrimily (getUnique i)
    
    148 148
                 in  CHeader (char tag <> word64 u)
    
    149 149
     
    
    150 150
       normal_args = map (\(nm,_ty,_,_) -> nm) arg_info
    

  • compiler/GHC/Iface/Binary.hs
    ... ... @@ -707,7 +707,7 @@ putName BinSymbolTable{
    707 707
                    bin_symtab_next = symtab_next }
    
    708 708
             bh name
    
    709 709
       | isKnownKeyName name
    
    710
    -  , let (c, u) = unpkUniqueGrimly (nameUnique name) -- INVARIANT: (ord c) fits in 8 bits
    
    710
    +  , let (c, u) = unpkUniqueGrimily (nameUnique name) -- INVARIANT: (ord c) fits in 8 bits
    
    711 711
       = -- assert (u < 2^(22 :: Int))
    
    712 712
         put_ bh (0x80000000
    
    713 713
                  .|. (fromIntegral (ord c) `shiftL` 22)
    

  • compiler/GHC/Stg/Pipeline.hs
    ... ... @@ -66,9 +66,9 @@ newtype StgM a = StgM { _unStgM :: ReaderT Char IO a }
    66 66
     
    
    67 67
     instance MonadUnique StgM where
    
    68 68
       getUniqueSupplyM = StgM $ do { tag <- ask
    
    69
    -                               ; liftIO $! mkSplitUniqSupplyGrimly tag}
    
    69
    +                               ; liftIO $! mkSplitUniqSupplyGrimily tag}
    
    70 70
       getUniqueM = StgM $ do { tag <- ask
    
    71
    -                         ; liftIO $! uniqFromTagGrimly tag}
    
    71
    +                         ; liftIO $! uniqFromTagGrimily tag}
    
    72 72
     
    
    73 73
     runStgM :: UniqueTag -> StgM a -> IO a
    
    74 74
     runStgM mask (StgM m) = runReaderT m (uniqueTag mask)
    

  • compiler/GHC/StgToJS/Ids.hs
    ... ... @@ -130,7 +130,7 @@ makeIdentForId i num id_type current_module = name ident
    130 130
             -- unique suffix for non-exported Ids
    
    131 131
           , if exported
    
    132 132
               then mempty
    
    133
    -          else let (c,u) = unpkUniqueGrimly (getUnique i)
    
    133
    +          else let (c,u) = unpkUniqueGrimily (getUnique i)
    
    134 134
                    in mconcat [BSC.pack ['_',c,'_'], word64BS u]
    
    135 135
           ]
    
    136 136
     
    
    ... ... @@ -235,4 +235,3 @@ declVarsForId i = case typeSize (idType i) of
    235 235
       0 -> return mempty
    
    236 236
       1 -> decl <$> identForId i
    
    237 237
       s -> mconcat <$> mapM (\n -> decl <$> identForIdN i n) [1..s]
    238
    -

  • compiler/GHC/Tc/Utils/Monad.hs
    ... ... @@ -1008,13 +1008,13 @@ newUnique :: TcRnIf gbl lcl Unique
    1008 1008
     newUnique
    
    1009 1009
      = do { env <- getEnv
    
    1010 1010
           ; let tag = env_ut env
    
    1011
    -      ; liftIO $! uniqFromTagGrimly tag }
    
    1011
    +      ; liftIO $! uniqFromTagGrimily tag }
    
    1012 1012
     
    
    1013 1013
     newUniqueSupply :: TcRnIf gbl lcl UniqSupply
    
    1014 1014
     newUniqueSupply
    
    1015 1015
      = do { env <- getEnv
    
    1016 1016
           ; let tag = env_ut env
    
    1017
    -      ; liftIO $! mkSplitUniqSupplyGrimly tag }
    
    1017
    +      ; liftIO $! mkSplitUniqSupplyGrimily tag }
    
    1018 1018
     
    
    1019 1019
     cloneLocalName :: Name -> TcM Name
    
    1020 1020
     -- Make a fresh Internal name with the same OccName and SrcSpan
    

  • compiler/GHC/Types/Name/Cache.hs
    ... ... @@ -122,7 +122,7 @@ data NameCache = NameCache
    122 122
     type OrigNameCache   = ModuleEnv (OccEnv Name)
    
    123 123
     
    
    124 124
     takeUniqFromNameCache :: NameCache -> IO Unique
    
    125
    -takeUniqFromNameCache (NameCache c _) = uniqFromTagGrimly c
    
    125
    +takeUniqFromNameCache (NameCache c _) = uniqFromTagGrimily c
    
    126 126
     
    
    127 127
     lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name
    
    128 128
     lookupOrigNameCache nc mod occ = lookup_infinite <|> lookup_normal
    

  • compiler/GHC/Types/Unique.hs
    ... ... @@ -38,12 +38,12 @@ module GHC.Types.Unique (
    38 38
             mkUniqueIntGrimily,
    
    39 39
             getKey,
    
    40 40
             mkUnique, unpkUnique,
    
    41
    -        unpkUniqueGrimly,
    
    41
    +        unpkUniqueGrimily,
    
    42 42
             mkUniqueInt,
    
    43 43
             eqUnique, ltUnique,
    
    44 44
             incrUnique, stepUnique,
    
    45 45
     
    
    46
    -        newTagUnique, newTagUniqueGrimly,
    
    46
    +        newTagUnique, newTagUniqueGrimily,
    
    47 47
             nonDetCmpUnique,
    
    48 48
             isValidKnownKeyUnique,
    
    49 49
     
    
    ... ... @@ -99,7 +99,7 @@ Note [Performance implications of UniqueTag]
    99 99
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    100 100
     The UniqueTag ADT is meant to be ephemeral and eliminated by the simplifier,
    
    101 101
     so for long term storage (i.e. in monadic environments or data structures) we
    
    102
    -want to store the raw 'Char's. Working with the raw tags is done via the *Grimly
    
    102
    +want to store the raw 'Char's. Working with the raw tags is done via the *Grimily
    
    103 103
     class of functions
    
    104 104
     
    
    105 105
     For instance, if we are generating a unique for a concrete tag, we should use
    
    ... ... @@ -116,7 +116,7 @@ newUnique
    116 116
            ; liftIO $! uniqFromTag tag }
    
    117 117
     
    
    118 118
     Prefer `env_ut :: Char` and
    
    119
    -       ; liftIO $! uniqFromTagGrimly tag }
    
    119
    +       ; liftIO $! uniqFromTagGrimily tag }
    
    120 120
     
    
    121 121
     -}
    
    122 122
     
    
    ... ... @@ -295,7 +295,7 @@ The stuff about unique *supplies* is handled further down this module.
    295 295
     -}
    
    296 296
     
    
    297 297
     unpkUnique :: Unique -> (UniqueTag, Word64)        -- The reverse
    
    298
    -unpkUniqueGrimly :: Unique -> (Char, Word64)        -- The reverse
    
    298
    +unpkUniqueGrimily :: Unique -> (Char, Word64)        -- The reverse
    
    299 299
     
    
    300 300
     mkUniqueGrimily :: Word64 -> Unique                -- A trap-door for UniqSupply
    
    301 301
     getKey          :: Unique -> Word64                -- for Var
    
    ... ... @@ -303,7 +303,7 @@ getKey :: Unique -> Word64 -- for Var
    303 303
     incrUnique   :: Unique -> Unique
    
    304 304
     stepUnique   :: Unique -> Word64 -> Unique
    
    305 305
     newTagUnique :: Unique -> UniqueTag -> Unique
    
    306
    -newTagUniqueGrimly :: Unique -> Char -> Unique
    
    306
    +newTagUniqueGrimily :: Unique -> Char -> Unique
    
    307 307
     
    
    308 308
     mkUniqueGrimily = MkUnique
    
    309 309
     
    
    ... ... @@ -323,9 +323,9 @@ maxLocalUnique :: Unique
    323 323
     maxLocalUnique = mkLocalUnique uniqueMask
    
    324 324
     
    
    325 325
     -- newTagUnique changes the "domain" of a unique to a different char
    
    326
    -newTagUnique u c = newTagUniqueGrimly u (uniqueTag c)
    
    326
    +newTagUnique u c = newTagUniqueGrimily u (uniqueTag c)
    
    327 327
     
    
    328
    -newTagUniqueGrimly u c = mkUniqueGrimilyWithTag c i where (_,i) = unpkUniqueGrimly u
    
    328
    +newTagUniqueGrimily u c = mkUniqueGrimilyWithTag c i where (_,i) = unpkUniqueGrimily u
    
    329 329
     
    
    330 330
     -- | Bitmask that has zeros for the tag bits and ones for the rest.
    
    331 331
     uniqueMask :: Word64
    
    ... ... @@ -368,7 +368,7 @@ mkUniqueIntGrimily = MkUnique . intToWord64
    368 368
     
    
    369 369
     {-# INLINE mkUniqueIntGrimily #-}
    
    370 370
     
    
    371
    -unpkUniqueGrimly (MkUnique u)
    
    371
    +unpkUniqueGrimily (MkUnique u)
    
    372 372
       = let
    
    373 373
             -- The potentially truncating use of fromIntegral here is safe
    
    374 374
             -- because the argument is just the tag bits after shifting.
    
    ... ... @@ -376,10 +376,10 @@ unpkUniqueGrimly (MkUnique u)
    376 376
             i   = u .&. uniqueMask
    
    377 377
         in
    
    378 378
         (tag, i)
    
    379
    -{-# INLINE unpkUniqueGrimly #-}
    
    379
    +{-# INLINE unpkUniqueGrimily #-}
    
    380 380
     
    
    381 381
     
    
    382
    -unpkUnique u = case unpkUniqueGrimly u of
    
    382
    +unpkUnique u = case unpkUniqueGrimily u of
    
    383 383
       (c, i) -> ( charToUniqueTag c, i)
    
    384 384
     {-# INLINE unpkUnique #-}
    
    385 385
     
    
    ... ... @@ -389,7 +389,7 @@ unpkUnique u = case unpkUniqueGrimly u of
    389 389
     -- See Note [Symbol table representation of names] in "GHC.Iface.Binary" for details.
    
    390 390
     isValidKnownKeyUnique :: Unique -> Bool
    
    391 391
     isValidKnownKeyUnique u =
    
    392
    -    case unpkUniqueGrimly u of
    
    392
    +    case unpkUniqueGrimily u of
    
    393 393
           (c, x) -> ord c < 0xff && x <= (1 `shiftL` 22)
    
    394 394
     
    
    395 395
     {-
    
    ... ... @@ -512,7 +512,7 @@ showUnique :: Unique -> String
    512 512
     showUnique uniq
    
    513 513
       = tagStr ++ w64ToBase62 u
    
    514 514
       where
    
    515
    -    (tag, u) = unpkUniqueGrimly uniq
    
    515
    +    (tag, u) = unpkUniqueGrimily uniq
    
    516 516
         -- Avoid emitting non-printable characters in pretty uniques.
    
    517 517
         -- See #25989.
    
    518 518
         tagStr
    

  • compiler/GHC/Types/Unique/Supply.hs
    ... ... @@ -16,10 +16,10 @@ module GHC.Types.Unique.Supply (
    16 16
             -- ** Operations on supplies
    
    17 17
             uniqFromSupply, uniqsFromSupply, -- basic ops
    
    18 18
             takeUniqFromSupply,
    
    19
    -        uniqFromTag, uniqFromTagGrimly,
    
    19
    +        uniqFromTag, uniqFromTagGrimily,
    
    20 20
             UniqueTag(..),
    
    21 21
     
    
    22
    -        mkSplitUniqSupply, mkSplitUniqSupplyGrimly,
    
    22
    +        mkSplitUniqSupply, mkSplitUniqSupplyGrimily,
    
    23 23
             splitUniqSupply, listSplitUniqSupply,
    
    24 24
     
    
    25 25
             -- * Unique supply monad and its abstraction
    
    ... ... @@ -203,10 +203,10 @@ data UniqSupply
    203 203
                                     -- when split => these two supplies
    
    204 204
     
    
    205 205
     mkSplitUniqSupply  :: UniqueTag -> IO UniqSupply
    
    206
    -mkSplitUniqSupply ut = mkSplitUniqSupplyGrimly (uniqueTag ut)
    
    206
    +mkSplitUniqSupply ut = mkSplitUniqSupplyGrimily (uniqueTag ut)
    
    207 207
     {-# INLINE mkSplitUniqSupply #-}
    
    208 208
     
    
    209
    -mkSplitUniqSupplyGrimly :: Char -> IO UniqSupply
    
    209
    +mkSplitUniqSupplyGrimily :: Char -> IO UniqSupply
    
    210 210
     -- ^ Create a unique supply out of thin air.
    
    211 211
     -- The "tag" (Char) supplied is mostly cosmetic, making it easier
    
    212 212
     -- to figure out where a Unique was born. See Note [Uniques and tags].
    
    ... ... @@ -219,7 +219,7 @@ mkSplitUniqSupplyGrimly :: Char -> IO UniqSupply
    219 219
     
    
    220 220
     -- See Note [How the unique supply works]
    
    221 221
     -- See Note [Optimising the unique supply]
    
    222
    -mkSplitUniqSupplyGrimly ut
    
    222
    +mkSplitUniqSupplyGrimily ut
    
    223 223
       = unsafeDupableInterleaveIO (IO mk_supply)
    
    224 224
     
    
    225 225
       where
    
    ... ... @@ -286,15 +286,15 @@ initUniqSupply counter inc = do
    286 286
         poke ghc_unique_inc       inc
    
    287 287
     
    
    288 288
     uniqFromTag :: UniqueTag -> IO Unique
    
    289
    -uniqFromTag !ut = uniqFromTagGrimly (uniqueTag ut)
    
    289
    +uniqFromTag !ut = uniqFromTagGrimily (uniqueTag ut)
    
    290 290
     
    
    291 291
     {-# INLINE uniqFromTag #-}
    
    292 292
     
    
    293
    -uniqFromTagGrimly :: Char -> IO Unique
    
    294
    -uniqFromTagGrimly !tag
    
    293
    +uniqFromTagGrimily :: Char -> IO Unique
    
    294
    +uniqFromTagGrimily !tag
    
    295 295
       = do { uqNum <- genSym
    
    296 296
            ; return $! mkUniqueGrimilyWithTag tag uqNum }
    
    297
    -{-# NOINLINE uniqFromTagGrimly #-} -- We'll unbox everything, but we don't want to inline it
    
    297
    +{-# NOINLINE uniqFromTagGrimily #-} -- We'll unbox everything, but we don't want to inline it
    
    298 298
     
    
    299 299
     splitUniqSupply :: UniqSupply -> (UniqSupply, UniqSupply)
    
    300 300
     -- ^ Build two 'UniqSupply' from a single one, each of which