[commit: ghc] master: More comments about InlinePragmas (b1e6415)

git at git.haskell.org git at git.haskell.org
Wed Aug 3 13:05:44 UTC 2016


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

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

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

commit b1e641558239b41825372db239cabbe2c42f7b5f
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Wed Aug 3 14:04:53 2016 +0100

    More comments about InlinePragmas
    
    Just pointers about where to look in the source code.


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

b1e641558239b41825372db239cabbe2c42f7b5f
 compiler/basicTypes/BasicTypes.hs | 2 ++
 compiler/deSugar/DsBinds.hs       | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs
index 92a1740..f72625b 100644
--- a/compiler/basicTypes/BasicTypes.hs
+++ b/compiler/basicTypes/BasicTypes.hs
@@ -980,6 +980,8 @@ if an Id has defaultInlinePragma it means the user didn't specify anything.
 
 If inl_inline = Inline or Inlineable, then the Id should have an InlineRule unfolding.
 
+If you want to know where InlinePragmas take effect: Look in DsBinds.mkCorePair
+
 Note [CONLIKE pragma]
 ~~~~~~~~~~~~~~~~~~~~~
 The ConLike constructor of a RuleMatchInfo is aimed at the following.
diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs
index 30e1707..f5211d2 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/deSugar/DsBinds.hs
@@ -347,6 +347,11 @@ dsHsBind dflags (AbsBindsSig { abs_tvs = tyvars, abs_ev_vars = dicts
 dsHsBind _ (PatSynBind{}) = panic "dsHsBind: PatSynBind"
 
 
+
+-- | This is where we apply INLINE and INLINABLE pragmas. All we need to
+-- do is to attach the unfolding information to the Id. When the interface
+-- files are created, unfoldings are only attached if the information is
+-- present.
 ------------------------
 makeCorePair :: DynFlags -> Id -> Bool -> Arity -> CoreExpr -> (Id, CoreExpr)
 makeCorePair dflags gbl_id is_default_method dict_arity rhs



More information about the ghc-commits mailing list