Commit 615fa148 authored by dterei's avatar dterei

SafeHaskell: Remove dead alternate flag check method

parent 01c96916
......@@ -1269,83 +1269,6 @@ shFlagsDisallowed dflags = foldl check_method (dflags, []) bad_flags
safeFailure str = [L noSrcSpan $ "Warning2: " ++ str ++ " is not allowed in"
++ " SafeHaskell; ignoring " ++ str]
{-
-- ALTERNATE SAFE HASKELL CHECK METHOD
-- | Extensions that can only be enabled on the command line when compiling in
-- Safe mode
shFlagsCmdLineOnly :: Monad m => DynFlags -> DynFlags -> m ()
shFlagsCmdLineOnly oldf newf = mapM_ check_method bad_flags
where
check_method (test,str) = when test $ safeFailure str
ext_test ext = xopt ext newf && not (xopt ext oldf)
pgm_test pgm = pgm oldf == pgm newf
dyn_test dyn = dopt dyn newf && not (dopt dyn oldf)
bad_flags = [ (ext_test Opt_TemplateHaskell, "TemplateHaskell")
, (ext_test Opt_Cpp, "CPP")
, (dyn_test Opt_Pp, "F")
, (pgm_test pgm_lo, "pgmlo")
, (pgm_test pgm_lc, "pgmlc")
, (pgm_test pgm_L, "pgmL")
, (pgm_test pgm_P, "pgmP")
, (pgm_test pgm_F, "pgmF")
, (pgm_test pgm_c, "pgmc")
, (pgm_test pgm_m, "pgmm")
, (pgm_test pgm_s, "pgms")
, (pgm_test pgm_a, "pgma")
, (pgm_test pgm_l, "pgml")
, (pgm_test pgm_dll, "pgmdll")
, (pgm_test pgm_windres, "pgmwindres")
, (pgm_test opt_lo, "optlo")
, (pgm_test opt_lc, "optlc")
, (pgm_test opt_L, "optL")
, (pgm_test opt_P, "optP")
, (pgm_test opt_F, "optF")
, (pgm_test opt_c, "optc")
, (pgm_test opt_m, "optm")
, (pgm_test opt_a, "opta")
, (pgm_test opt_l, "optl OR l")
, (pgm_test opt_windres, "optlwindres")
, (pgm_test mainFunIs
&& pgm_test mainModIs, "main-is")
, (pgm_test libraryPaths, "L")
, (pgm_test dynLibLoader, "dynload")
, (pgm_test hcSuf, "hcsuf")
, (pgm_test hiSuf, "hisuf")
, (pgm_test objectSuf, "osuf")
, (pgm_test hiDir, "hidir")
, (pgm_test objectDir, "odir")
, (pgm_test stubDir, "stubdir")
, (pgm_test outputHi, "ohi")
, (pgm_test outputFile, "o")
, (pgm_test tmpDir, "tmpdir")
, (pgm_test includePaths, "I")
, (pgm_test rtsOpts, "with-rtsopts")
, (pgm_test rtsOptsEnabled, "rtsopts")
, (pgm_test dylibInstallName, "dylib-install-name")
]
-- safeFailure :: MonadIO m => String -> m ()
safeFailure :: Monad m => String -> m ()
safeFailure s = ghcError $ CmdLineError $ "Illegal extension (" ++ s
++ ") in use while compiling with Safe Haskell!"
{-
-- prefer this error but circular imports arise.
= liftIO $ throwIO $ mkSrcErr $ unitBag $ mkPlainErrMsg noSrcSpan $
text "Illegal extension (" <> text s <>
text ") in use while compiling with Safe Haskell!"
-}
-}
{- **********************************************************************
%* *
......
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