I also made the -ffloat-all-lams flag not take an argument, as it just
ignored it.
-{-# OPTIONS_GHC -w #-}
--- Temporary, until rtsIsProfiled is fixed
-
import SrcLoc
import FastString
import Outputable
import SrcLoc
import FastString
import Outputable
import Foreign.C ( CInt )
import Foreign.C ( CInt )
import {-# SOURCE #-} ErrUtils ( Severity(..), Message, mkLocMessage )
import {-# SOURCE #-} ErrUtils ( Severity(..), Message, mkLocMessage )
import System.IO.Unsafe ( unsafePerformIO )
import System.IO.Unsafe ( unsafePerformIO )
import Data.IORef
import Control.Monad ( when )
import Data.IORef
import Control.Monad ( when )
import Data.List
import Data.Map (Map)
import qualified Data.Map as Map
import Data.List
import Data.Map (Map)
import qualified Data.Map as Map
import System.FilePath
import System.IO ( stderr, hPutChar )
import System.FilePath
import System.IO ( stderr, hPutChar )
, Flag "fcontext-stack" (intSuffix (\n d -> d{ ctxtStkDepth = n }))
, Flag "fstrictness-before" (intSuffix (\n d -> d{ strictnessBefore = n : strictnessBefore d }))
, Flag "ffloat-lam-args" (intSuffix (\n d -> d{ floatLamArgs = Just n }))
, Flag "fcontext-stack" (intSuffix (\n d -> d{ ctxtStkDepth = n }))
, Flag "fstrictness-before" (intSuffix (\n d -> d{ strictnessBefore = n : strictnessBefore d }))
, Flag "ffloat-lam-args" (intSuffix (\n d -> d{ floatLamArgs = Just n }))
- , Flag "ffloat-all-lams" (intSuffix (\n d -> d{ floatLamArgs = Nothing }))
+ , Flag "ffloat-all-lams" (noArg (\d -> d{ floatLamArgs = Nothing }))
------ Profiling ----------------------------------------------------
------ Profiling ----------------------------------------------------
rtsIsProfiled :: Bool
rtsIsProfiled = unsafePerformIO rtsIsProfiledIO /= 0
rtsIsProfiled :: Bool
rtsIsProfiled = unsafePerformIO rtsIsProfiledIO /= 0
checkTemplateHaskellOk :: Bool -> DynP ()
checkTemplateHaskellOk :: Bool -> DynP ()
-checkTemplateHaskellOk turn_on
+#ifdef GHCI
+checkTemplateHaskellOk turn_on
| turn_on && rtsIsProfiled
= addErr "You can't use Template Haskell with a profiled compiler"
| otherwise
= return ()
#else
| turn_on && rtsIsProfiled
= addErr "You can't use Template Haskell with a profiled compiler"
| otherwise
= return ()
#else
--- In stage 1 we don't know that the RTS has rts_isProfiled,
+-- In stage 1 we don't know that the RTS has rts_isProfiled,
-- so we simply say "ok". It doesn't matter because TH isn't
-- available in stage 1 anyway.
-- so we simply say "ok". It doesn't matter because TH isn't
-- available in stage 1 anyway.
-checkTemplateHaskellOk turn_on = return ()
+checkTemplateHaskellOk _ = return ()
#endif
{- **********************************************************************
#endif
{- **********************************************************************
-- platform.
machdepCCOpts :: DynFlags -> [String] -- flags for all C compilations
-- platform.
machdepCCOpts :: DynFlags -> [String] -- flags for all C compilations
-machdepCCOpts dflags = cCcOpts ++ machdepCCOpts'
+machdepCCOpts _ = cCcOpts ++ machdepCCOpts'
machdepCCOpts' :: [String] -- flags for all C compilations
machdepCCOpts'
machdepCCOpts' :: [String] -- flags for all C compilations
machdepCCOpts'