summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-05-12 19:38:57 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2016-08-21 00:53:21 -0700
commit704913cf79c7dbf9bf622fb3cfe476edd478b5a2 (patch)
tree7f45bfa7646e877309ac32c5822a7db9d1c28b71 /libraries
parente907e1f12f4dedc0ec13c7a501c8810bcfc03583 (diff)
downloadhaskell-704913cf79c7dbf9bf622fb3cfe476edd478b5a2.tar.gz
Support for noinline magic function.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2209
Diffstat (limited to 'libraries')
-rw-r--r--libraries/ghc-prim/GHC/Magic.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/ghc-prim/GHC/Magic.hs b/libraries/ghc-prim/GHC/Magic.hs
index 495705b3b4..96f1742dea 100644
--- a/libraries/ghc-prim/GHC/Magic.hs
+++ b/libraries/ghc-prim/GHC/Magic.hs
@@ -21,7 +21,7 @@
--
-----------------------------------------------------------------------------
-module GHC.Magic ( inline, lazy, oneShot, runRW# ) where
+module GHC.Magic ( inline, noinline, lazy, oneShot, runRW# ) where
import GHC.Prim
import GHC.CString ()
@@ -45,6 +45,13 @@ import GHC.CString ()
inline :: a -> a
inline x = x
+-- | The call @noinline f@ arranges that 'f' will not be inlined.
+-- It is removed during CorePrep so that its use imposes no overhead
+-- (besides the fact that it blocks inlining.)
+{-# NOINLINE noinline #-}
+noinline :: a -> a
+noinline x = x
+
-- | The 'lazy' function restrains strictness analysis a little. The
-- call @lazy e@ means the same as 'e', but 'lazy' has a magical
-- property so far as strictness analysis is concerned: it is lazy in