From b051c4f7046c494f16946f7c356f23dea74dea1a Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 23 Nov 2009 19:46:09 +0000 Subject: [PATCH] Add new GHC.Magic module --- GHC/Magic.hs | 29 +++++++++++++++++++++++++++++ ghc-prim.cabal | 1 + 2 files changed, 30 insertions(+) create mode 100644 GHC/Magic.hs diff --git a/GHC/Magic.hs b/GHC/Magic.hs new file mode 100644 index 0000000..b450e79 --- /dev/null +++ b/GHC/Magic.hs @@ -0,0 +1,29 @@ +----------------------------------------------------------------------------- +-- | +-- Module : GHC.Magic +-- Copyright : (c) The University of Glasgow 2009 +-- License : see libraries/ghc-prim/LICENSE +-- +-- Maintainer : cvs-ghc@haskell.org +-- Stability : internal +-- Portability : non-portable (GHC Extensions) +-- +-- GHC magic. +-- Use GHC.Exts from the base package instead of importing this +-- module directly. +-- +----------------------------------------------------------------------------- + +{-# OPTIONS_GHC -XNoImplicitPrelude #-} + +module GHC.Magic (inline) where + +-- | The call '(inline f)' reduces to 'f', but 'inline' has a BuiltInRule +-- that tries to inline 'f' (if it has an unfolding) unconditionally +-- The 'NOINLINE' pragma arranges that inline only gets inlined (and +-- hence eliminated) late in compilation, after the rule has had +-- a good chance to fire. +inline :: a -> a +{-# NOINLINE[0] inline #-} +inline x = x + diff --git a/ghc-prim.cabal b/ghc-prim.cabal index ea52c32..c887b6c 100644 --- a/ghc-prim.cabal +++ b/ghc-prim.cabal @@ -25,6 +25,7 @@ Library { GHC.Bool GHC.Debug GHC.Generics + GHC.Magic GHC.Ordering GHC.PrimopWrappers GHC.IntWord32 -- 1.7.10.4