[commit: ghc] wip/T9732: Apply compulsory unfoldings during desugaring (3df7ad1)

git at git.haskell.org git at git.haskell.org
Wed Nov 12 09:38:01 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T9732
Link       : http://ghc.haskell.org/trac/ghc/changeset/3df7ad1921afe1a231d00cd3bcf49a6554ecd3af/ghc

>---------------------------------------------------------------

commit 3df7ad1921afe1a231d00cd3bcf49a6554ecd3af
Author: Gergo Erdi <gergo.erdi at sc.com>
Date:   Wed Nov 12 10:24:44 2014 +0800

    Apply compulsory unfoldings during desugaring


>---------------------------------------------------------------

3df7ad1921afe1a231d00cd3bcf49a6554ecd3af
 compiler/deSugar/DsExpr.lhs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/deSugar/DsExpr.lhs b/compiler/deSugar/DsExpr.lhs
index 6844f48..004a80b 100644
--- a/compiler/deSugar/DsExpr.lhs
+++ b/compiler/deSugar/DsExpr.lhs
@@ -191,7 +191,11 @@ dsLExpr (L loc e) = putSrcSpanDs loc $ dsExpr e
 dsExpr :: HsExpr Id -> DsM CoreExpr
 dsExpr (HsPar e)              = dsLExpr e
 dsExpr (ExprWithTySigOut e _) = dsLExpr e
-dsExpr (HsVar var)            = return (varToCoreExpr var)   -- See Note [Desugaring vars]
+dsExpr (HsVar var)
+  | isCompulsoryUnfolding unfolding = return $ unfoldingTemplate unfolding
+  | otherwise = return (varToCoreExpr var)   -- See Note [Desugaring vars]
+  where
+    unfolding = idUnfolding var
 dsExpr (HsIPVar _)            = panic "dsExpr: HsIPVar"
 dsExpr (HsLit lit)            = dsLit lit
 dsExpr (HsOverLit lit)        = dsOverLit lit



More information about the ghc-commits mailing list