opt_D_dump_ds,
opt_D_dump_flatC,
opt_D_dump_foreign,
+ opt_D_dump_hi_diffs,
opt_D_dump_inlinings,
opt_D_dump_occur_anal,
opt_D_dump_parsed,
opt_D_dump_stg,
opt_D_dump_stranal,
opt_D_dump_tc,
+ opt_D_dump_types,
opt_D_dump_usagesp,
opt_D_dump_worker_wrapper,
opt_D_show_passes,
opt_AllowOverlappingInstances,
opt_AllowUndecidableInstances,
opt_GlasgowExts,
+ opt_Generics,
opt_IrrefutableTuples,
opt_NumbersStrict,
opt_Parallel,
opt_SimplCaseOfCase,
opt_SimplCaseMerge,
opt_SimplPedanticBottoms,
+ opt_SimplExcessPrecision,
-- Unfolding control
opt_UF_HiFileThreshold,
opt_UF_CreationThreshold,
opt_UF_UseThreshold,
- opt_UF_ScrutConDiscount,
opt_UF_FunAppDiscount,
- opt_UF_PrimArgDiscount,
opt_UF_KeenessFactor,
+ opt_UF_UpdateInPlace,
opt_UF_CheapOp,
opt_UF_DearOp,
opt_OmitInterfacePragmas,
opt_ProduceExportCStubs,
opt_ProduceExportHStubs,
- opt_ProduceHi,
+ opt_HiFile,
+ opt_HiDir,
+ opt_HiSuf,
+ opt_NoPruneTyDecls,
opt_NoPruneDecls,
opt_ReportCompile,
opt_SourceUnchanged,
import Constants -- Default values for some flags
import FastString ( headFS )
-import Maybes ( assocMaybe, firstJust, maybeToBool )
+import Maybes ( firstJust, maybeToBool )
import Panic ( panic, panic# )
#if __GLASGOW_HASKELL__ < 301
| CoreDoSpecialising
| CoreDoUSPInf
| CoreDoCPResult
+ | CoreDoGlomBinds
| CoreCSE
\end{code}
lookup_def_float :: String -> Float -> Float
lookup_str :: String -> Maybe String
-lookUp sw = maybeToBool (assoc_opts sw)
+lookUp sw = sw `elem` argv
lookup_str sw = firstJust (map (startsWith sw) unpacked_opts)
Nothing -> def -- Use default
Just xx -> read xx
-assoc_opts = assocMaybe [ (a, True) | a <- argv ]
unpacked_opts = map _UNPK_ argv
{-
a pure Win32 application where I think there's a command-line
length limit of 255. unpacked_opts understands the @ option.
-assoc_opts = assocMaybe [ (_PK_ a, True) | a <- unpacked_opts ]
-
unpacked_opts :: [String]
unpacked_opts =
concat $
opt_D_dump_stg = opt_D_dump_most || lookUp SLIT("-ddump-stg")
opt_D_dump_stranal = opt_D_dump_most || lookUp SLIT("-ddump-stranal")
opt_D_dump_tc = opt_D_dump_most || lookUp SLIT("-ddump-tc")
+opt_D_dump_types = opt_D_dump_most || lookUp SLIT("-ddump-types")
opt_D_dump_rules = opt_D_dump_most || lookUp SLIT("-ddump-rules")
opt_D_dump_usagesp = opt_D_dump_most || lookUp SLIT("-ddump-usagesp")
opt_D_dump_cse = opt_D_dump_most || lookUp SLIT("-ddump-cse")
opt_D_source_stats = opt_D_dump_most || lookUp SLIT("-dsource-stats")
opt_D_verbose_core2core = opt_D_dump_all || lookUp SLIT("-dverbose-simpl")
opt_D_verbose_stg2stg = opt_D_dump_all || lookUp SLIT("-dverbose-stg")
+opt_D_dump_hi_diffs = opt_D_dump_all || lookUp SLIT("-ddump-hi-diffs")
+
opt_D_dump_minimal_imports = lookUp SLIT("-ddump-minimal-imports")
opt_DoCoreLinting = lookUp SLIT("-dcore-lint")
opt_AllowOverlappingInstances = lookUp SLIT("-fallow-overlapping-instances")
opt_AllowUndecidableInstances = lookUp SLIT("-fallow-undecidable-instances")
opt_GlasgowExts = lookUp SLIT("-fglasgow-exts")
+opt_Generics = lookUp SLIT("-fgenerics")
opt_IrrefutableTuples = lookUp SLIT("-firrefutable-tuples")
opt_MaxContextReductionDepth = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
opt_NumbersStrict = lookUp SLIT("-fnumbers-strict")
opt_OmitInterfacePragmas = lookUp SLIT("-fomit-interface-pragmas")
opt_ProduceExportCStubs = lookup_str "-F="
opt_ProduceExportHStubs = lookup_str "-FH="
-opt_ProduceHi = lookup_str "-hifile=" -- the one to produce this time
+
+-- where to generate the .hi file
+opt_HiFile = lookup_str "-hifile="
+opt_HiDir = lookup_str "-hidir="
+opt_HiSuf = lookup_str "-hisuf="
-- Language for output: "C", "asm", "java", maybe more
-- Nothing => don't output anything
opt_SimplCaseOfCase = lookUp SLIT("-fcase-of-case")
opt_SimplCaseMerge = lookUp SLIT("-fcase-merge")
opt_SimplPedanticBottoms = lookUp SLIT("-fpedantic-bottoms")
+opt_SimplExcessPrecision = lookUp SLIT("-fexcess-precision")
-- Unfolding control
opt_UF_HiFileThreshold = lookup_def_int "-funfolding-interface-threshold" (45::Int)
opt_UF_CreationThreshold = lookup_def_int "-funfolding-creation-threshold" (45::Int)
opt_UF_UseThreshold = lookup_def_int "-funfolding-use-threshold" (8::Int) -- Discounts can be big
-opt_UF_ScrutConDiscount = lookup_def_int "-funfolding-con-discount" (2::Int)
opt_UF_FunAppDiscount = lookup_def_int "-funfolding-fun-discount" (6::Int) -- It's great to inline a fn
-opt_UF_PrimArgDiscount = lookup_def_int "-funfolding-prim-discount" (1::Int)
opt_UF_KeenessFactor = lookup_def_float "-funfolding-keeness-factor" (1.5::Float)
+opt_UF_UpdateInPlace = lookUp SLIT("-funfolding-update-in-place")
opt_UF_CheapOp = ( 1 :: Int) -- Only one instruction; and the args are charged for
opt_UF_DearOp = ( 4 :: Int)
opt_ReportCompile = lookUp SLIT("-freport-compile")
opt_NoPruneDecls = lookUp SLIT("-fno-prune-decls")
+opt_NoPruneTyDecls = lookUp SLIT("-fno-prune-tydecls")
opt_SourceUnchanged = lookUp SLIT("-fsource-unchanged")
opt_Static = lookUp SLIT("-static")
opt_Unregisterised = lookUp SLIT("-funregisterised")
"-ffloat-outwards-full" -> CORE_TD(CoreDoFloatOutwards True)
"-fliberate-case" -> CORE_TD(CoreLiberateCase)
"-fcse" -> CORE_TD(CoreCSE)
+ "-fglom-binds" -> CORE_TD(CoreDoGlomBinds)
"-fprint-core" -> CORE_TD(CoreDoPrintCore)
"-fstatic-args" -> CORE_TD(CoreDoStaticArgs)
"-fstrictness" -> CORE_TD(CoreDoStrictness)