[commit: ghc] master: More misc comments (b4d5459)

git at git.haskell.org git at git.haskell.org
Mon Jun 25 16:46:08 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b4d545904ed7f883ad03b8746a610ae2f3640437/ghc

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

commit b4d545904ed7f883ad03b8746a610ae2f3640437
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jun 7 09:17:22 2018 +0100

    More misc comments
    
    ... plus, reorder equations in toIfaceVar to improve
    legibility.  No change in behaviour.


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

b4d545904ed7f883ad03b8746a610ae2f3640437
 compiler/basicTypes/MkId.hs     |  7 +++----
 compiler/iface/ToIface.hs       | 15 +++++++++------
 compiler/simplCore/OccurAnal.hs |  3 +++
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index d6a52b4d..602cd3d 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -1183,7 +1183,7 @@ proxyName         = mkWiredInIdName gHC_PRIM  (fsLit "proxy#")         proxyHash
 lazyIdName, oneShotName, noinlineIdName :: Name
 lazyIdName        = mkWiredInIdName gHC_MAGIC (fsLit "lazy")           lazyIdKey          lazyId
 oneShotName       = mkWiredInIdName gHC_MAGIC (fsLit "oneShot")        oneShotKey         oneShotId
-noinlineIdName    = mkWiredInIdName gHC_MAGIC (fsLit "noinline") noinlineIdKey noinlineId
+noinlineIdName    = mkWiredInIdName gHC_MAGIC (fsLit "noinline")       noinlineIdKey      noinlineId
 
 ------------------------------------------------
 proxyHashId :: Id
@@ -1431,9 +1431,8 @@ a little bit of magic to optimize away 'noinline' after we are done
 running the simplifier.
 
 'noinline' needs to be wired-in because it gets inserted automatically
-when we serialize an expression to the interface format, and we DON'T
-want use its fingerprints.
-
+when we serialize an expression to the interface format. See
+Note [Inlining and hs-boot files] in ToIface
 
 Note [The oneShot function]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/compiler/iface/ToIface.hs b/compiler/iface/ToIface.hs
index d148e9a..4b810fa 100644
--- a/compiler/iface/ToIface.hs
+++ b/compiler/iface/ToIface.hs
@@ -535,14 +535,17 @@ mkIfaceApps f as = foldl (\f a -> IfaceApp f (toIfaceExpr a)) f as
 ---------------------
 toIfaceVar :: Id -> IfaceExpr
 toIfaceVar v
-    | Just fcall <- isFCallId_maybe v            = IfaceFCall fcall (toIfaceType (idType v))
-       -- Foreign calls have special syntax
     | isBootUnfolding (idUnfolding v)
-    = IfaceApp (IfaceApp (IfaceExt noinlineIdName) (IfaceType (toIfaceType (idType v))))
+    = -- See Note [Inlining and hs-boot files]
+      IfaceApp (IfaceApp (IfaceExt noinlineIdName)
+                         (IfaceType (toIfaceType (idType v))))
                (IfaceExt name) -- don't use mkIfaceApps, or infinite loop
-       -- See Note [Inlining and hs-boot files]
-    | isExternalName name                        = IfaceExt name
-    | otherwise                                  = IfaceLcl (getOccFS name)
+
+    | Just fcall <- isFCallId_maybe v = IfaceFCall fcall (toIfaceType (idType v))
+                                      -- Foreign calls have special syntax
+
+    | isExternalName name             = IfaceExt name
+    | otherwise                       = IfaceLcl (getOccFS name)
   where name = idName v
 
 
diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs
index a8cfbc0..5c0c3b1 100644
--- a/compiler/simplCore/OccurAnal.hs
+++ b/compiler/simplCore/OccurAnal.hs
@@ -2295,6 +2295,9 @@ Core Lint never expects to find an *occurrence* of an Id marked
 as Dead, so we must zap the OccInfo on cb before making the
 binding x = cb.  See Trac #5028.
 
+NB: the OccInfo on /occurrences/ really doesn't matter much; the simplifier
+doesn't use it. So this is only to satisfy the perhpas-over-picky Lint.
+
 Historical note [no-case-of-case]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 We *used* to suppress the binder-swap in case expressions when



More information about the ghc-commits mailing list