-- parsing DynFlags
parseDynamicFlags,
+ allFlags,
-- misc stuff
machdepCCOpts, picCCOpts,
| Opt_D_dump_hi
| Opt_D_dump_hi_diffs
| Opt_D_dump_minimal_imports
+ | Opt_D_faststring_stats
| Opt_DoCoreLinting
| Opt_DoStgLinting
| Opt_DoCmmLinting
| Opt_Generics
| Opt_ImplicitPrelude
| Opt_ScopedTypeVariables
+ | Opt_BangPatterns
-- optimisation opts
| Opt_Strictness
| Opt_OmitInterfacePragmas
| Opt_DoLambdaEtaExpansion
| Opt_IgnoreAsserts
+ | Opt_IgnoreBreakpoints
| Opt_DoEtaReduction
| Opt_CaseMerge
| Opt_UnboxStrictFields
stgToDo :: Maybe [StgToDo], -- similarly
hscTarget :: HscTarget,
hscOutName :: String, -- name of the output file
- hscStubHOutName :: String, -- name of the .stub_h output file
- hscStubCOutName :: String, -- name of the .stub_c output file
extCoreName :: String, -- name of the .core output file
verbosity :: Int, -- verbosity level
optLevel :: Int, -- optimisation level
rtsBuildTag :: String, -- the RTS "way"
-- paths etc.
- outputDir :: Maybe String,
- outputFile :: Maybe String,
- outputHi :: Maybe String,
+ objectDir :: Maybe String,
+ hiDir :: Maybe String,
+ stubDir :: Maybe String,
+
objectSuf :: String,
hcSuf :: String,
- hiDir :: Maybe String,
hiSuf :: String,
+
+ outputFile :: Maybe String,
+ outputHi :: Maybe String,
+
includePaths :: [String],
libraryPaths :: [String],
frameworkPaths :: [String], -- used on darwin only
stgToDo = Nothing,
hscTarget = defaultHscTarget,
hscOutName = "",
- hscStubHOutName = "",
- hscStubCOutName = "",
extCoreName = "",
verbosity = 0,
optLevel = 0,
buildTag = panic "buildTag",
rtsBuildTag = panic "rtsBuildTag",
- outputDir = Nothing,
- outputFile = Nothing,
- outputHi = Nothing,
+ objectDir = Nothing,
+ hiDir = Nothing,
+ stubDir = Nothing,
+
objectSuf = phaseInputExt StopLn,
hcSuf = phaseInputExt HCc,
- hiDir = Nothing,
hiSuf = "hi",
+
+ outputFile = Nothing,
+ outputHi = Nothing,
includePaths = [],
libraryPaths = [],
frameworkPaths = [],
| verbosity dflags >= 3 = "-v"
| otherwise = ""
-setOutputDir f d = d{ outputDir = f}
-setOutputFile f d = d{ outputFile = f}
-setOutputHi f d = d{ outputHi = f}
+setObjectDir f d = d{ objectDir = f}
+setHiDir f d = d{ hiDir = f}
+setStubDir f d = d{ stubDir = f}
+
setObjectSuf f d = d{ objectSuf = f}
-setHcSuf f d = d{ hcSuf = f}
setHiSuf f d = d{ hiSuf = f}
-setHiDir f d = d{ hiDir = f}
+setHcSuf f d = d{ hcSuf = f}
+
+setOutputFile f d = d{ outputFile = f}
+setOutputHi f d = d{ outputHi = f}
-- XXX HACK: Prelude> words "'does not' work" ===> ["'does","not'","work"]
-- Config.hs should really use Option.
-- -----------------------------------------------------------------------------
-- DynFlags parser
+allFlags :: [String]
+allFlags = map ('-':) $
+ [ name | (name, optkind) <- dynamic_flags, ok optkind ] ++
+ map ("fno-"++) flags ++
+ map ("f"++) flags
+ where ok (PrefixPred _ _) = False
+ ok _ = True
+ flags = map fst fFlags
+
dynamic_flags :: [(String, OptKind DynP)]
dynamic_flags = [
( "n" , NoArg (setDynFlag Opt_DryRun) )
, ( "framework" , HasArg (upd . addCmdlineFramework) )
------- Output Redirection ------------------------------------------
- , ( "odir" , HasArg (upd . setOutputDir . Just))
+ , ( "odir" , HasArg (upd . setObjectDir . Just))
, ( "o" , SepArg (upd . setOutputFile . Just))
, ( "ohi" , HasArg (upd . setOutputHi . Just ))
, ( "osuf" , HasArg (upd . setObjectSuf))
, ( "hisuf" , HasArg (upd . setHiSuf))
, ( "hidir" , HasArg (upd . setHiDir . Just))
, ( "tmpdir" , HasArg (upd . setTmpDir))
+ , ( "stubdir" , HasArg (upd . setStubDir . Just))
------- Keeping temporary files -------------------------------------
, ( "keep-hc-file" , AnySuffix (\_ -> setDynFlag Opt_KeepHcFiles))
, ( "dverbose-stg2stg", setDumpFlag Opt_D_verbose_stg2stg)
, ( "ddump-hi-diffs", NoArg (setDynFlag Opt_D_dump_hi_diffs))
, ( "ddump-hi", setDumpFlag Opt_D_dump_hi)
- , ( "ddump-minimal-imports", setDumpFlag Opt_D_dump_minimal_imports)
+ , ( "ddump-minimal-imports", NoArg (setDynFlag Opt_D_dump_minimal_imports))
, ( "ddump-vect", setDumpFlag Opt_D_dump_vect)
, ( "dcore-lint", NoArg (setDynFlag Opt_DoCoreLinting))
, ( "dstg-lint", NoArg (setDynFlag Opt_DoStgLinting))
, ( "dcmm-lint", NoArg (setDynFlag Opt_DoCmmLinting))
, ( "dshow-passes", NoArg (do unSetDynFlag Opt_RecompChecking
setVerbosity "2") )
+ , ( "dfaststring-stats", NoArg (setDynFlag Opt_D_faststring_stats))
------ Machine dependant (-m<blah>) stuff ---------------------------
( "th", Opt_TH ),
( "implicit-prelude", Opt_ImplicitPrelude ),
( "scoped-type-variables", Opt_ScopedTypeVariables ),
+ ( "bang-patterns", Opt_BangPatterns ),
( "monomorphism-restriction", Opt_MonomorphismRestriction ),
( "implicit-params", Opt_ImplicitParams ),
( "allow-overlapping-instances", Opt_AllowOverlappingInstances ),
( "omit-interface-pragmas", Opt_OmitInterfacePragmas ),
( "do-lambda-eta-expansion", Opt_DoLambdaEtaExpansion ),
( "ignore-asserts", Opt_IgnoreAsserts ),
+ ( "ignore-breakpoints", Opt_IgnoreBreakpoints),
( "do-eta-reduction", Opt_DoEtaReduction ),
( "case-merge", Opt_CaseMerge ),
( "unbox-strict-fields", Opt_UnboxStrictFields ),
Opt_FFI,
Opt_TH,
Opt_ImplicitParams,
- Opt_ScopedTypeVariables ]
+ Opt_ScopedTypeVariables,
+ Opt_BangPatterns ]
isFFlag f = f `elem` (map fst fFlags)
getFFlag f = fromJust (lookup f fFlags)
#elif x86_64_TARGET_ARCH
= ( [], ["-fomit-frame-pointer",
- "-fno-asynchronous-unwind-tables"
+ "-fno-asynchronous-unwind-tables",
-- the unwind tables are unnecessary for HC code,
-- and get in the way of -split-objs. Another option
-- would be to throw them away in the mangler, but this
-- is easier.
+ "-fno-unit-at-a-time",
+ -- unit-at-a-time doesn't do us any good, and screws
+ -- up -split-objs by moving the split markers around.
+ -- It's only turned on with -O2, but put it here just
+ -- in case someone uses -optc-O2.
+ "-fno-builtin"
+ -- calling builtins like strlen() using the FFI can
+ -- cause gcc to run out of regs, so use the external
+ -- version.
] )
#elif mips_TARGET_ARCH