enabling -fno-warn- (#246).

This commit is contained in:
Kazu Yamamoto
2014-05-09 23:45:34 +09:00
parent c05b27b65b
commit 2e3b172b0e
2 changed files with 17 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ module Language.Haskell.GhcMod.GHCApi (
, getDynamicFlags
, getSystemLibDir
, withDynFlags
, withCmdFlags
, setNoWaringFlags
, setAllWaringFlags
) where
@@ -176,6 +177,15 @@ withDynFlags setFlag body = G.gbracket setup teardown (\_ -> body)
return dflag
teardown = void . G.setSessionDynFlags
withCmdFlags :: [GHCOption] -> Ghc a -> Ghc a
withCmdFlags flags body = G.gbracket setup teardown (\_ -> body)
where
setup = do
dflag <- G.getSessionDynFlags >>= addCmdOpts flags
void $ G.setSessionDynFlags dflag
return dflag
teardown = void . G.setSessionDynFlags
----------------------------------------------------------------
-- | Set 'DynFlags' equivalent to "-w:".