diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-05-12 19:38:57 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-08-21 00:53:21 -0700 |
commit | 704913cf79c7dbf9bf622fb3cfe476edd478b5a2 (patch) | |
tree | 7f45bfa7646e877309ac32c5822a7db9d1c28b71 /libraries | |
parent | e907e1f12f4dedc0ec13c7a501c8810bcfc03583 (diff) | |
download | haskell-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.hs | 9 |
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 |