set Opt_SpecConstr just in case.
This commit is contained in:
parent
2f0c8b1293
commit
0ce70ae22d
@ -1,16 +1,14 @@
|
|||||||
module Language.Haskell.GhcMod.DynFlags where
|
module Language.Haskell.GhcMod.DynFlags where
|
||||||
|
|
||||||
import qualified Language.Haskell.GhcMod.Gap as Gap
|
|
||||||
import Language.Haskell.GhcMod.Types
|
|
||||||
|
|
||||||
import Control.Applicative ((<$>))
|
import Control.Applicative ((<$>))
|
||||||
import Control.Monad (forM, void, (>=>))
|
import Control.Monad (forM, void, (>=>))
|
||||||
|
import DynFlags (ExtensionFlag(..), xopt, GeneralFlag(..), gopt_unset)
|
||||||
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 GhcMonad
|
|
||||||
import GHC.Paths (libdir)
|
import GHC.Paths (libdir)
|
||||||
import DynFlags (ExtensionFlag(..), xopt)
|
import GhcMonad
|
||||||
|
import qualified Language.Haskell.GhcMod.Gap as Gap
|
||||||
|
import Language.Haskell.GhcMod.Types
|
||||||
import System.IO.Unsafe (unsafePerformIO)
|
import System.IO.Unsafe (unsafePerformIO)
|
||||||
|
|
||||||
data Build = CabalPkg | SingleFile deriving Eq
|
data Build = CabalPkg | SingleFile deriving Eq
|
||||||
@ -42,6 +40,9 @@ 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 }
|
||||||
|
|
||||||
|
@ -190,6 +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
|
||||||
$ setIncludeDirs includeDirs
|
$ setIncludeDirs includeDirs
|
||||||
$ setBuildEnv build
|
$ setBuildEnv build
|
||||||
$ setEmptyLogger
|
$ setEmptyLogger
|
||||||
|
Loading…
Reference in New Issue
Block a user