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