summaryrefslogtreecommitdiff
path: root/ghc/compiler/hsSyn
diff options
context:
space:
mode:
authorsimonm <unknown>1998-05-22 15:23:51 +0000
committersimonm <unknown>1998-05-22 15:23:51 +0000
commitf36fb2ce821caf594c1db5669dd10ca082f66361 (patch)
tree4964ea970f1dbd28fb400df68b559740586e0e2b /ghc/compiler/hsSyn
parentab29b7806ead26dbebc9e04b54fec078e97ea104 (diff)
downloadhaskell-f36fb2ce821caf594c1db5669dd10ca082f66361.tar.gz
[project @ 1998-05-22 15:23:11 by simonm]
Add NOINLINE pragma. - add new type of inline info: IDontWantToBeINLINEd - hopefully get the interactions between IMustNotBeINLINEd (which is used by the simplifier to ensure termination when simplifying recursive binding groups) and IDontWantToBeINLINEd. - no need to pass NOINLINE across modules, we just make sure that any function marked as NOLINE doesn't get an unfolding in the interface.
Diffstat (limited to 'ghc/compiler/hsSyn')
-rw-r--r--ghc/compiler/hsSyn/HsBinds.lhs17
1 files changed, 12 insertions, 5 deletions
diff --git a/ghc/compiler/hsSyn/HsBinds.lhs b/ghc/compiler/hsSyn/HsBinds.lhs
index d6246f15e5..f75117cecb 100644
--- a/ghc/compiler/hsSyn/HsBinds.lhs
+++ b/ghc/compiler/hsSyn/HsBinds.lhs
@@ -222,6 +222,9 @@ data Sig name
| InlineSig name -- INLINE f
SrcLoc
+ | NoInlineSig name -- NOINLINE f
+ SrcLoc
+
| SpecInstSig (HsType name) -- (Class tys); should be a specialisation of the
-- current instance decl
SrcLoc
@@ -232,11 +235,12 @@ sigsForMe :: (name -> Bool) -> [Sig name] -> [Sig name]
sigsForMe f sigs
= filter sig_for_me sigs
where
- sig_for_me (Sig n _ _) = f n
- sig_for_me (ClassOpSig n _ _ _) = f n
- sig_for_me (SpecSig n _ _ _) = f n
- sig_for_me (InlineSig n _) = f n
- sig_for_me (SpecInstSig _ _) = False
+ sig_for_me (Sig n _ _) = f n
+ sig_for_me (ClassOpSig n _ _ _) = f n
+ sig_for_me (SpecSig n _ _ _) = f n
+ sig_for_me (InlineSig n _) = f n
+ sig_for_me (NoInlineSig n _) = f n
+ sig_for_me (SpecInstSig _ _) = False
\end{code}
\begin{code}
@@ -263,6 +267,9 @@ ppr_sig (SpecSig var ty using _)
ppr_sig (InlineSig var _)
= hsep [text "{-# INLINE", ppr var, text "#-}"]
+ppr_sig (NoInlineSig var _)
+ = hsep [text "{-# NOINLINE", ppr var, text "#-}"]
+
ppr_sig (SpecInstSig ty _)
= hsep [text "{-# SPECIALIZE instance", ppr ty, text "#-}"]
\end{code}