[commit: ghc] wip/nested-cpr: Leave singleton (# . #) in place if they were already there (6729a76)
git at git.haskell.org
git at git.haskell.org
Thu Dec 5 14:13:44 UTC 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nested-cpr
Link : http://ghc.haskell.org/trac/ghc/changeset/6729a76e0250d2dd8c5b458a825aabf2c2de204d/ghc
>---------------------------------------------------------------
commit 6729a76e0250d2dd8c5b458a825aabf2c2de204d
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Thu Dec 5 11:49:14 2013 +0000
Leave singleton (# . #) in place if they were already there
>---------------------------------------------------------------
6729a76e0250d2dd8c5b458a825aabf2c2de204d
compiler/stranal/WwLib.lhs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index ba56060..b79dc05 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -536,13 +536,16 @@ mkWWcpr :: Type -- function body type
mkWWcpr body_ty res
= do (arg_vars, con_app, decon) <- mkWWcpr_help False body_ty res
case arg_vars of
+ -- Do leave things alone if it is a non-nested unboxed tuple.
+ -- How does this relates to the next case? Seems to make a difference
+ -- in Text.Read.Lex, for example.
+ _ | isWWUseless body_ty res -> return (id, id, body_ty)
+
-- When we have to wrap only on argument, skip the (# .. #)
[arg_var] -> do
return ( \ wkr_call -> mkRename wkr_call arg_var con_app
, \ body -> decon body (Var arg_var)
, idType arg_var )
-
- _ | isWWUseless body_ty res -> return (id, id, body_ty)
_ -> do
wrap_wild_uniq <- getUniqueM
More information about the ghc-commits
mailing list