moving setFlags to Gap.
This commit is contained in:
parent
0ce70ae22d
commit
233f4cf05e
@ -2,7 +2,7 @@ module Language.Haskell.GhcMod.DynFlags where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import Control.Monad (forM, void, (>=>))
|
||||
import DynFlags (ExtensionFlag(..), xopt, GeneralFlag(..), gopt_unset)
|
||||
import DynFlags (ExtensionFlag(..), xopt)
|
||||
import GHC (DynFlags(..), GhcMode(..), GhcLink(..), HscTarget(..), LoadHowMuch(..))
|
||||
import qualified GHC as G
|
||||
import GHC.Paths (libdir)
|
||||
@ -40,9 +40,6 @@ setModeIntelligent df = df {
|
||||
, optLevel = 0
|
||||
}
|
||||
|
||||
setFlags :: DynFlags -> DynFlags
|
||||
setFlags df = df `gopt_unset` Opt_SpecConstr -- consume memory if -O2
|
||||
|
||||
setIncludeDirs :: [IncludeDir] -> DynFlags -> DynFlags
|
||||
setIncludeDirs idirs df = df { importPaths = idirs }
|
||||
|
||||
|
@ -39,6 +39,7 @@ module Language.Haskell.GhcMod.Gap (
|
||||
, GLMatch
|
||||
, getClass
|
||||
, occName
|
||||
, setFlags
|
||||
) where
|
||||
|
||||
import Control.Applicative hiding (empty)
|
||||
@ -459,3 +460,13 @@ getClass _ = Nothing
|
||||
occName :: RdrName -> OccName
|
||||
occName = rdrNameOcc
|
||||
#endif
|
||||
|
||||
----------------------------------------------------------------
|
||||
----------------------------------------------------------------
|
||||
|
||||
setFlags :: DynFlags -> DynFlags
|
||||
#if __GLASGOW_HASKELL__ >= 708
|
||||
setFlags df = df `gopt_unset` Opt_SpecConstr -- consume memory if -O2
|
||||
#else
|
||||
setFlags = id
|
||||
#endif
|
||||
|
@ -190,7 +190,7 @@ initSession build Options {..} CompilerOptions {..} = do
|
||||
df <- G.getSessionDynFlags
|
||||
void $ G.setSessionDynFlags =<< addCmdOpts ghcOptions
|
||||
( setModeSimple
|
||||
$ setFlags
|
||||
$ Gap.setFlags
|
||||
$ setIncludeDirs includeDirs
|
||||
$ setBuildEnv build
|
||||
$ setEmptyLogger
|
||||
|
Loading…
Reference in New Issue
Block a user