set Opt_SpecConstr just in case.

This commit is contained in:
Kazu Yamamoto 2014-07-18 10:52:57 +09:00
parent 2f0c8b1293
commit 0ce70ae22d
2 changed files with 8 additions and 6 deletions

View File

@ -1,16 +1,14 @@
module Language.Haskell.GhcMod.DynFlags where
import qualified Language.Haskell.GhcMod.Gap as Gap
import Language.Haskell.GhcMod.Types
import Control.Applicative ((<$>))
import Control.Monad (forM, void, (>=>))
import DynFlags (ExtensionFlag(..), xopt, GeneralFlag(..), gopt_unset)
import GHC (DynFlags(..), GhcMode(..), GhcLink(..), HscTarget(..), LoadHowMuch(..))
import qualified GHC as G
import GhcMonad
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)
data Build = CabalPkg | SingleFile deriving Eq
@ -42,6 +40,9 @@ 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 }

View File

@ -190,6 +190,7 @@ initSession build Options {..} CompilerOptions {..} = do
df <- G.getSessionDynFlags
void $ G.setSessionDynFlags =<< addCmdOpts ghcOptions
( setModeSimple
$ setFlags
$ setIncludeDirs includeDirs
$ setBuildEnv build
$ setEmptyLogger