[Git][ghc/ghc][wip/with2-primop] 2 commits: Fix shadowing

Ben Gamari gitlab at gitlab.haskell.org
Thu Apr 16 15:49:50 UTC 2020



Ben Gamari pushed to branch wip/with2-primop at Glasgow Haskell Compiler / GHC


Commits:
936fb080 by Ben Gamari at 2020-04-16T02:18:02+00:00
Fix shadowing

- - - - -
790805ec by Ben Gamari at 2020-04-16T02:18:07+00:00
Core Lint logic for keepAlive#

- - - - -


1 changed file:

- compiler/GHC/Core/Lint.hs


Changes:

=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -861,6 +861,19 @@ lintCoreExpr e@(App _ _)
        ; arg3_ty <- lintJoinLams 1 (Just fun) arg3
        ; lintValApp arg3 fun_ty2 arg3_ty }
 
+  | Var fun <- fun
+  , fun `hasKey` keepAliveIdKey
+  , [arg_ty1, arg_ty2, arg_ty3, arg_ty4, arg5, arg6, arg7] <- args
+  = do { fun_ty1 <- lintCoreArg (idType fun)  arg_ty1  -- ra :: RuntimeRep
+       ; fun_ty2 <- lintCoreArg fun_ty1       arg_ty2  -- a  :: TYPE ra
+       ; fun_ty3 <- lintCoreArg fun_ty2       arg_ty3  -- ro :: RuntimeRep
+       ; fun_ty4 <- lintCoreArg fun_ty3       arg_ty4  -- o  :: TYPE ro
+       ; fun_ty5 <- lintCoreArg fun_ty4       arg5     -- x  :: a
+       ; arg_ty6 <- lintJoinLams 1 (Just fun) arg6     -- f  :: State# RW -> (# State# RW, o #)
+       ; fun_ty6 <- lintValApp arg6 fun_ty5 arg_ty6
+       ; lintCoreArg fun_ty6 arg7                      -- s0 :: State# RW
+       }
+
   | otherwise
   = do { fun_ty <- lintCoreFun fun (length args)
        ; lintCoreArgs fun_ty args }
@@ -1124,9 +1137,9 @@ lintTyApp fun_ty arg_ty
 -----------------
 lintValApp :: CoreExpr -> LintedType -> LintedType -> LintM LintedType
 lintValApp arg fun_ty arg_ty
-  | Just (arg_ty', _res_ty') <- splitFunTy_maybe fun_ty
+  | Just (arg_ty', res_ty') <- splitFunTy_maybe fun_ty
   = do { ensureEqTys arg_ty' arg_ty err1
-       ; return res }
+       ; return res_ty' }
   | otherwise
   = failWithL err2
   where



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f72af5f4b764beca6a16229c647f59da9925477...790805ecc57d1a732efa4baacae1a9ce6c413d6e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f72af5f4b764beca6a16229c647f59da9925477...790805ecc57d1a732efa4baacae1a9ce6c413d6e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200416/4669acd4/attachment-0001.html>


More information about the ghc-commits mailing list