X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=5031deda931fe4ada6d36ddb1ccb0d2c908c2b9d;hb=6084fb5517da34f65034370a3695e2af3b85ce2b;hp=14491877cf789c4938fef507b5bdcb4538b02cc6;hpb=90c32262025049ae3013e8af1e9960756dace72d;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 1449187..5031ded 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -69,7 +69,7 @@ import DriverPhases ( Phase(..), phaseInputExt ) import Config import CmdLineParser import Constants ( mAX_CONTEXT_REDUCTION_DEPTH ) -import Panic ( panic, GhcException(..) ) +import Panic import UniqFM ( UniqFM ) import Util import Maybes ( orElse ) @@ -78,7 +78,6 @@ import Outputable import {-# SOURCE #-} ErrUtils ( Severity(..), Message, mkLocMessage ) import Data.IORef ( readIORef ) -import Control.Exception ( throwDyn ) import Control.Monad ( when ) import Data.Char @@ -174,6 +173,7 @@ data DynFlag | Opt_WarnDodgyImports | Opt_WarnOrphans | Opt_WarnTabs + | Opt_WarnUnrecognisedPragmas | Opt_WarnDodgyForeignImports -- language opts @@ -278,6 +278,7 @@ data DynFlag | Opt_RunCPSZ | Opt_ConvertToZipCfgAndBack | Opt_AutoLinkPackages + | Opt_ImplicitImportQualified -- keeping stuff | Opt_KeepHiDiffs @@ -793,6 +794,7 @@ standardWarnings :: [DynFlag] standardWarnings = [ Opt_WarnWarningsDeprecations, Opt_WarnDeprecatedFlags, + Opt_WarnUnrecognisedPragmas, Opt_WarnOverlappingPatterns, Opt_WarnMissingFields, Opt_WarnMissingMethods, @@ -828,6 +830,7 @@ minuswRemovesOpts Opt_WarnIncompletePatternsRecUpd, Opt_WarnSimplePatterns, Opt_WarnMonomorphism, + Opt_WarnUnrecognisedPragmas, Opt_WarnTabs ] @@ -1106,15 +1109,24 @@ dynamic_flags = [ Supported -------- ghc -M ----------------------------------------------------- - , Flag "optdep-s" (HasArg (upd . addDepSuffix)) Supported - , Flag "optdep-f" (HasArg (upd . setDepMakefile)) Supported + , Flag "dep-suffix" (HasArg (upd . addDepSuffix)) Supported + , Flag "optdep-s" (HasArg (upd . addDepSuffix)) + (Deprecated "Use -dep-suffix instead") + , Flag "dep-makefile" (HasArg (upd . setDepMakefile)) Supported + , Flag "optdep-f" (HasArg (upd . setDepMakefile)) + (Deprecated "Use -dep-makefile instead") , Flag "optdep-w" (NoArg (upd (setDepWarnings False))) (Deprecated "-optdep-w doesn't do anything") + , Flag "include-pkg-deps" (NoArg (upd (setDepIncludePkgDeps True))) Supported , Flag "optdep--include-prelude" (NoArg (upd (setDepIncludePkgDeps True))) - (Deprecated "Use -optdep--include-pkg-deps instead") - , Flag "optdep--include-pkg-deps" (NoArg (upd (setDepIncludePkgDeps True))) Supported - , Flag "optdep--exclude-module" (HasArg (upd . addDepExcludeMod)) Supported - , Flag "optdep-x" (HasArg (upd . addDepExcludeMod)) Supported + (Deprecated "Use -include-pkg-deps instead") + , Flag "optdep--include-pkg-deps" (NoArg (upd (setDepIncludePkgDeps True))) + (Deprecated "Use -include-pkg-deps instead") + , Flag "exclude-module" (HasArg (upd . addDepExcludeMod)) Supported + , Flag "optdep--exclude-module" (HasArg (upd . addDepExcludeMod)) + (Deprecated "Use -exclude-module instead") + , Flag "optdep-x" (HasArg (upd . addDepExcludeMod)) + (Deprecated "Use -exclude-module instead") -------- Linking ---------------------------------------------------- , Flag "c" (NoArg (upd $ \d -> d{ ghcLink=NoLink } )) @@ -1456,6 +1468,7 @@ fFlags = [ ( "warn-deprecated-flags", Opt_WarnDeprecatedFlags, const Supported ), ( "warn-orphans", Opt_WarnOrphans, const Supported ), ( "warn-tabs", Opt_WarnTabs, const Supported ), + ( "warn-unrecognised-pragmas", Opt_WarnUnrecognisedPragmas, const Supported ), ( "print-explicit-foralls", Opt_PrintExplicitForalls, const Supported ), ( "strictness", Opt_Strictness, const Supported ), ( "static-argument-transformation", Opt_StaticArgumentTransformation, const Supported ), @@ -1520,7 +1533,8 @@ fFlags = [ ( "allow-incoherent-instances", Opt_IncoherentInstances, deprecatedForLanguage "IncoherentInstances" ), ( "gen-manifest", Opt_GenManifest, const Supported ), - ( "embed-manifest", Opt_EmbedManifest, const Supported ) + ( "embed-manifest", Opt_EmbedManifest, const Supported ), + ( "implicit-import-qualified", Opt_ImplicitImportQualified, const Supported ) ] supportedLanguages :: [String] @@ -1655,7 +1669,7 @@ parseDynamicFlags dflags args = do let ((leftover, errs, warns), dflags') = runCmdLine (processArgs dynamic_flags args') dflags when (not (null errs)) $ do - throwDyn (UsageError (unlines errs)) + ghcError (UsageError (unlines errs)) return (dflags', leftover, warns) type DynP = CmdLineP DynFlags @@ -1747,7 +1761,7 @@ ignorePackage p = setPackageName :: String -> DynFlags -> DynFlags setPackageName p | Nothing <- unpackPackageId pid - = throwDyn (CmdLineError ("cannot parse \'" ++ p ++ "\' as a package identifier")) + = ghcError (CmdLineError ("cannot parse \'" ++ p ++ "\' as a package identifier")) | otherwise = \s -> s{ thisPackage = pid } where