Commit 1e26e60d authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot

Simplify monadic code

parent 6a47414f
...@@ -1283,12 +1283,11 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags ...@@ -1283,12 +1283,11 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
= do = do
-- LLVM from version 3.0 onwards doesn't support the OS X system -- LLVM from version 3.0 onwards doesn't support the OS X system
-- assembler, so we use clang as the assembler instead. (#5636) -- assembler, so we use clang as the assembler instead. (#5636)
let whichAsProg | hscTarget dflags == HscLlvm && let as_prog | hscTarget dflags == HscLlvm &&
platformOS (targetPlatform dflags) == OSDarwin platformOS (targetPlatform dflags) == OSDarwin
= return SysTools.runClang = SysTools.runClang
| otherwise = return SysTools.runAs | otherwise = SysTools.runAs
as_prog <- whichAsProg
let cmdline_include_paths = includePaths dflags let cmdline_include_paths = includePaths dflags
let pic_c_flags = picCCOpts dflags let pic_c_flags = picCCOpts dflags
......
...@@ -683,14 +683,12 @@ checkNewInteractiveDynFlags :: MonadIO m => DynFlags -> m DynFlags ...@@ -683,14 +683,12 @@ checkNewInteractiveDynFlags :: MonadIO m => DynFlags -> m DynFlags
checkNewInteractiveDynFlags dflags0 = do checkNewInteractiveDynFlags dflags0 = do
-- We currently don't support use of StaticPointers in expressions entered on -- We currently don't support use of StaticPointers in expressions entered on
-- the REPL. See #12356. -- the REPL. See #12356.
dflags1 <- if xopt LangExt.StaticPointers dflags0
if xopt LangExt.StaticPointers dflags0 then do liftIO $ printOrThrowWarnings dflags0 $ listToBag
then do liftIO $ printOrThrowWarnings dflags0 $ listToBag [mkPlainWarnMsg dflags0 interactiveSrcSpan
[mkPlainWarnMsg dflags0 interactiveSrcSpan $ text "StaticPointers is not supported in GHCi interactive expressions."]
$ text "StaticPointers is not supported in GHCi interactive expressions."] return $ xopt_unset dflags0 LangExt.StaticPointers
return $ xopt_unset dflags0 LangExt.StaticPointers else return dflags0
else return dflags0
return dflags1
-- %************************************************************************ -- %************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment