+ , Flag "keep-tmp-files" (NoArg (setDynFlag Opt_KeepTmpFiles))
+
+ ------- Miscellaneous ----------------------------------------------
+ , Flag "no-auto-link-packages" (NoArg (unSetDynFlag Opt_AutoLinkPackages))
+ , Flag "no-hs-main" (NoArg (setDynFlag Opt_NoHsMain))
+ , Flag "with-rtsopts" (HasArg setRtsOpts)
+ , Flag "rtsopts" (NoArg (setRtsOptsEnabled RtsOptsAll))
+ , Flag "rtsopts=all" (NoArg (setRtsOptsEnabled RtsOptsAll))
+ , Flag "rtsopts=some" (NoArg (setRtsOptsEnabled RtsOptsSafeOnly))
+ , Flag "rtsopts=none" (NoArg (setRtsOptsEnabled RtsOptsNone))
+ , Flag "no-rtsopts" (NoArg (setRtsOptsEnabled RtsOptsNone))
+ , Flag "main-is" (SepArg setMainIs)
+ , Flag "haddock" (NoArg (setDynFlag Opt_Haddock))
+ , Flag "haddock-opts" (hasArg addHaddockOpts)
+ , Flag "hpcdir" (SepArg setOptHpcDir)
+
+ ------- recompilation checker --------------------------------------
+ , Flag "recomp" (NoArg (do { unSetDynFlag Opt_ForceRecomp
+ ; deprecate "Use -fno-force-recomp instead" }))
+ , Flag "no-recomp" (NoArg (do { setDynFlag Opt_ForceRecomp
+ ; deprecate "Use -fforce-recomp instead" }))
+
+ ------ HsCpp opts ---------------------------------------------------
+ , Flag "D" (AnySuffix (upd . addOptP))
+ , Flag "U" (AnySuffix (upd . addOptP))
+
+ ------- Include/Import Paths ----------------------------------------
+ , Flag "I" (Prefix addIncludePath)
+ , Flag "i" (OptPrefix addImportPath)
+
+ ------ Debugging ----------------------------------------------------
+ , Flag "dstg-stats" (NoArg (setDynFlag Opt_StgStats))
+
+ , Flag "ddump-cmm" (setDumpFlag Opt_D_dump_cmm)
+ , Flag "ddump-raw-cmm" (setDumpFlag Opt_D_dump_raw_cmm)
+ , Flag "ddump-cmmz" (setDumpFlag Opt_D_dump_cmmz)
+ , Flag "ddump-cmmz-pretty" (setDumpFlag Opt_D_dump_cmmz_pretty)
+ , Flag "ddump-core-stats" (setDumpFlag Opt_D_dump_core_stats)
+ , Flag "ddump-cps-cmm" (setDumpFlag Opt_D_dump_cps_cmm)
+ , Flag "ddump-cvt-cmm" (setDumpFlag Opt_D_dump_cvt_cmm)
+ , Flag "ddump-asm" (setDumpFlag Opt_D_dump_asm)
+ , Flag "ddump-asm-native" (setDumpFlag Opt_D_dump_asm_native)
+ , Flag "ddump-asm-liveness" (setDumpFlag Opt_D_dump_asm_liveness)
+ , Flag "ddump-asm-coalesce" (setDumpFlag Opt_D_dump_asm_coalesce)
+ , Flag "ddump-asm-regalloc" (setDumpFlag Opt_D_dump_asm_regalloc)
+ , Flag "ddump-asm-conflicts" (setDumpFlag Opt_D_dump_asm_conflicts)
+ , Flag "ddump-asm-regalloc-stages" (setDumpFlag Opt_D_dump_asm_regalloc_stages)
+ , Flag "ddump-asm-stats" (setDumpFlag Opt_D_dump_asm_stats)
+ , Flag "ddump-asm-expanded" (setDumpFlag Opt_D_dump_asm_expanded)
+ , Flag "ddump-llvm" (NoArg (do { setObjTarget HscLlvm
+ ; setDumpFlag' Opt_D_dump_llvm}))
+ , Flag "ddump-cpranal" (setDumpFlag Opt_D_dump_cpranal)
+ , Flag "ddump-deriv" (setDumpFlag Opt_D_dump_deriv)
+ , Flag "ddump-ds" (setDumpFlag Opt_D_dump_ds)
+ , Flag "ddump-flatC" (setDumpFlag Opt_D_dump_flatC)
+ , Flag "ddump-foreign" (setDumpFlag Opt_D_dump_foreign)
+ , Flag "ddump-inlinings" (setDumpFlag Opt_D_dump_inlinings)
+ , Flag "ddump-rule-firings" (setDumpFlag Opt_D_dump_rule_firings)
+ , Flag "ddump-rule-rewrites" (setDumpFlag Opt_D_dump_rule_rewrites)
+ , Flag "ddump-occur-anal" (setDumpFlag Opt_D_dump_occur_anal)
+ , Flag "ddump-parsed" (setDumpFlag Opt_D_dump_parsed)
+ , Flag "ddump-rn" (setDumpFlag Opt_D_dump_rn)
+ , Flag "ddump-simpl" (setDumpFlag Opt_D_dump_simpl)
+ , Flag "ddump-simpl-iterations" (setDumpFlag Opt_D_dump_simpl_iterations)
+ , Flag "ddump-simpl-phases" (OptPrefix setDumpSimplPhases)
+ , Flag "ddump-spec" (setDumpFlag Opt_D_dump_spec)
+ , Flag "ddump-prep" (setDumpFlag Opt_D_dump_prep)
+ , Flag "ddump-stg" (setDumpFlag Opt_D_dump_stg)
+ , Flag "ddump-stranal" (setDumpFlag Opt_D_dump_stranal)
+ , Flag "ddump-tc" (setDumpFlag Opt_D_dump_tc)
+ , Flag "ddump-types" (setDumpFlag Opt_D_dump_types)
+ , Flag "ddump-rules" (setDumpFlag Opt_D_dump_rules)
+ , Flag "ddump-cse" (setDumpFlag Opt_D_dump_cse)
+ , Flag "ddump-worker-wrapper" (setDumpFlag Opt_D_dump_worker_wrapper)
+ , Flag "ddump-rn-trace" (setDumpFlag Opt_D_dump_rn_trace)
+ , Flag "ddump-if-trace" (setDumpFlag Opt_D_dump_if_trace)
+ , Flag "ddump-cs-trace" (setDumpFlag Opt_D_dump_cs_trace)
+ , Flag "ddump-tc-trace" (setDumpFlag Opt_D_dump_tc_trace)
+ , Flag "ddump-vt-trace" (setDumpFlag Opt_D_dump_vt_trace)
+ , Flag "ddump-splices" (setDumpFlag Opt_D_dump_splices)
+ , Flag "ddump-rn-stats" (setDumpFlag Opt_D_dump_rn_stats)
+ , Flag "ddump-opt-cmm" (setDumpFlag Opt_D_dump_opt_cmm)
+ , Flag "ddump-simpl-stats" (setDumpFlag Opt_D_dump_simpl_stats)
+ , Flag "ddump-bcos" (setDumpFlag Opt_D_dump_BCOs)
+ , Flag "dsource-stats" (setDumpFlag Opt_D_source_stats)
+ , Flag "dverbose-core2core" (NoArg (do { setVerbosity (Just 2)
+ ; setVerboseCore2Core }))
+ , Flag "dverbose-stg2stg" (setDumpFlag Opt_D_verbose_stg2stg)
+ , Flag "ddump-hi" (setDumpFlag Opt_D_dump_hi)
+ , Flag "ddump-minimal-imports" (setDumpFlag Opt_D_dump_minimal_imports)
+ , Flag "ddump-vect" (setDumpFlag Opt_D_dump_vect)
+ , Flag "ddump-hpc" (setDumpFlag Opt_D_dump_hpc)
+ , Flag "ddump-mod-cycles" (setDumpFlag Opt_D_dump_mod_cycles)
+ , Flag "ddump-view-pattern-commoning" (setDumpFlag Opt_D_dump_view_pattern_commoning)
+ , Flag "ddump-to-file" (setDumpFlag Opt_DumpToFile)
+ , Flag "ddump-hi-diffs" (setDumpFlag Opt_D_dump_hi_diffs)
+ , Flag "ddump-rtti" (setDumpFlag Opt_D_dump_rtti)
+ , Flag "dcore-lint" (NoArg (setDynFlag Opt_DoCoreLinting))
+ , Flag "dstg-lint" (NoArg (setDynFlag Opt_DoStgLinting))
+ , Flag "dcmm-lint" (NoArg (setDynFlag Opt_DoCmmLinting))
+ , Flag "dasm-lint" (NoArg (setDynFlag Opt_DoAsmLinting))
+ , Flag "dshow-passes" (NoArg (do forceRecompile
+ setVerbosity (Just 2)))
+ , Flag "dfaststring-stats" (NoArg (setDynFlag Opt_D_faststring_stats))
+
+ ------ Machine dependant (-m<blah>) stuff ---------------------------
+
+ , Flag "monly-2-regs" (NoArg (addWarn "The -monly-2-regs flag does nothing; it will be removed in a future GHC release"))
+ , Flag "monly-3-regs" (NoArg (addWarn "The -monly-3-regs flag does nothing; it will be removed in a future GHC release"))
+ , Flag "monly-4-regs" (NoArg (addWarn "The -monly-4-regs flag does nothing; it will be removed in a future GHC release"))
+ , Flag "msse2" (NoArg (setDynFlag Opt_SSE2))
+
+ ------ Warning opts -------------------------------------------------
+ , Flag "W" (NoArg (mapM_ setDynFlag minusWOpts))
+ , Flag "Werror" (NoArg (setDynFlag Opt_WarnIsError))
+ , Flag "Wwarn" (NoArg (unSetDynFlag Opt_WarnIsError))
+ , Flag "Wall" (NoArg (mapM_ setDynFlag minusWallOpts))
+ , Flag "Wnot" (NoArg (do { mapM_ unSetDynFlag minusWallOpts
+ ; deprecate "Use -w instead" }))
+ , Flag "w" (NoArg (mapM_ unSetDynFlag minuswRemovesOpts))
+
+ ------ Optimisation flags ------------------------------------------
+ , Flag "O" (noArgM (setOptLevel 1))
+ , Flag "Onot" (noArgM (\dflags -> do deprecate "Use -O0 instead"
+ setOptLevel 0 dflags))
+ , Flag "Odph" (noArgM setDPHOpt)
+ , Flag "O" (optIntSuffixM (\mb_n -> setOptLevel (mb_n `orElse` 1)))
+ -- If the number is missing, use 1
+
+ , Flag "fsimplifier-phases" (intSuffix (\n d -> d{ simplPhases = n }))
+ , Flag "fmax-simplifier-iterations" (intSuffix (\n d -> d{ maxSimplIterations = n }))
+ , Flag "fspec-constr-threshold" (intSuffix (\n d -> d{ specConstrThreshold = Just n }))
+ , Flag "fno-spec-constr-threshold" (noArg (\d -> d{ specConstrThreshold = Nothing }))
+ , Flag "fspec-constr-count" (intSuffix (\n d -> d{ specConstrCount = Just n }))
+ , Flag "fno-spec-constr-count" (noArg (\d -> d{ specConstrCount = Nothing }))
+ , Flag "fliberate-case-threshold" (intSuffix (\n d -> d{ liberateCaseThreshold = Just n }))
+ , Flag "fno-liberate-case-threshold" (noArg (\d -> d{ liberateCaseThreshold = Nothing }))
+ , Flag "frule-check" (SepArg (\s -> upd (\d -> d{ ruleCheck = Just s })))
+ , Flag "fcontext-stack" (intSuffix (\n d -> d{ ctxtStkDepth = n }))
+ , Flag "fstrictness-before" (intSuffix (\n d -> d{ strictnessBefore = n : strictnessBefore d }))
+ , Flag "ffloat-lam-args" (intSuffix (\n d -> d{ floatLamArgs = Just n }))
+ , Flag "ffloat-all-lams" (noArg (\d -> d{ floatLamArgs = Nothing }))
+
+ ------ Profiling ----------------------------------------------------
+
+ -- XXX Should the -f* flags be deprecated?
+ -- They don't seem to be documented
+ , Flag "fauto-sccs-on-all-toplevs" (NoArg (setDynFlag Opt_AutoSccsOnAllToplevs))
+ , Flag "auto-all" (NoArg (setDynFlag Opt_AutoSccsOnAllToplevs))
+ , Flag "no-auto-all" (NoArg (unSetDynFlag Opt_AutoSccsOnAllToplevs))
+ , Flag "fauto-sccs-on-exported-toplevs" (NoArg (setDynFlag Opt_AutoSccsOnExportedToplevs))
+ , Flag "auto" (NoArg (setDynFlag Opt_AutoSccsOnExportedToplevs))
+ , Flag "no-auto" (NoArg (unSetDynFlag Opt_AutoSccsOnExportedToplevs))
+ , Flag "fauto-sccs-on-individual-cafs" (NoArg (setDynFlag Opt_AutoSccsOnIndividualCafs))
+ , Flag "caf-all" (NoArg (setDynFlag Opt_AutoSccsOnIndividualCafs))
+ , Flag "no-caf-all" (NoArg (unSetDynFlag Opt_AutoSccsOnIndividualCafs))
+
+ ------ DPH flags ----------------------------------------------------
+
+ , Flag "fdph-seq" (NoArg (setDPHBackend DPHSeq))
+ , Flag "fdph-par" (NoArg (setDPHBackend DPHPar))
+ , Flag "fdph-this" (NoArg (setDPHBackend DPHThis))
+ , Flag "fdph-none" (NoArg (setDPHBackend DPHNone))