SafeHaskell: Remove dead alternate flag check method
authorDavid Terei <davidterei@gmail.com>
Mon, 23 May 2011 21:23:33 +0000 (14:23 -0700)
committerDavid Terei <davidterei@gmail.com>
Sat, 18 Jun 2011 03:40:17 +0000 (20:40 -0700)
compiler/main/DynFlags.hs

index 0c6c6ac..ba18f49 100644 (file)
@@ -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!"
--}
--}
-
 
 {- **********************************************************************
 %*                                                                     *