| ghc-6.10.4: The GHC API | Contents | Index

DynFlags

Contents

Dynamic flags and associated configuration types
  Manipulating DynFlags
  Parsing DynFlags
  DynFlag C compiler options
Configuration of the core-to-core passes
Configuration of the stg-to-stg passes
Compiler configuration suitable for display to the user

Description
Dynamic flags (c) The University of Glasgow 2005
Synopsis

data DynFlag

= Opt_D_dump_cmm
| Opt_D_dump_cmmz
| Opt_D_dump_cmmz_pretty
| Opt_D_dump_cps_cmm
| Opt_D_dump_cvt_cmm
| Opt_D_dump_asm
| Opt_D_dump_asm_native
| Opt_D_dump_asm_liveness
| Opt_D_dump_asm_coalesce
| Opt_D_dump_asm_regalloc
| Opt_D_dump_asm_regalloc_stages
| Opt_D_dump_asm_conflicts
| Opt_D_dump_asm_stats
| Opt_D_dump_cpranal
| Opt_D_dump_deriv
| Opt_D_dump_ds
| Opt_D_dump_flatC
| Opt_D_dump_foreign
| Opt_D_dump_inlinings
| Opt_D_dump_rule_firings
| Opt_D_dump_occur_anal
| Opt_D_dump_parsed
| Opt_D_dump_rn
| Opt_D_dump_simpl
| Opt_D_dump_simpl_iterations
| Opt_D_dump_simpl_phases
| Opt_D_dump_spec
| Opt_D_dump_prep
| Opt_D_dump_stg
| Opt_D_dump_stranal
| Opt_D_dump_tc
| Opt_D_dump_types
| Opt_D_dump_rules
| Opt_D_dump_cse
| Opt_D_dump_worker_wrapper
| Opt_D_dump_rn_trace
| Opt_D_dump_rn_stats
| Opt_D_dump_opt_cmm
| Opt_D_dump_simpl_stats
| Opt_D_dump_tc_trace
| Opt_D_dump_if_trace
| Opt_D_dump_splices
| Opt_D_dump_BCOs
| Opt_D_dump_vect
| Opt_D_dump_hpc
| Opt_D_dump_rtti
| Opt_D_source_stats
| Opt_D_verbose_core2core
| Opt_D_verbose_stg2stg
| Opt_D_dump_hi
| Opt_D_dump_hi_diffs
| Opt_D_dump_minimal_imports
| Opt_D_dump_mod_cycles
| Opt_D_dump_view_pattern_commoning
| Opt_D_faststring_stats
| Opt_DumpToFile
| Opt_D_no_debug_output
| Opt_DoCoreLinting
| Opt_DoStgLinting
| Opt_DoCmmLinting
| Opt_DoAsmLinting
| Opt_WarnIsError
| Opt_WarnDuplicateExports
| Opt_WarnHiShadows
| Opt_WarnImplicitPrelude
| Opt_WarnIncompletePatterns
| Opt_WarnIncompletePatternsRecUpd
| Opt_WarnMissingFields
| Opt_WarnMissingMethods
| Opt_WarnMissingSigs
| Opt_WarnNameShadowing
| Opt_WarnOverlappingPatterns
| Opt_WarnSimplePatterns
| Opt_WarnTypeDefaults
| Opt_WarnMonomorphism
| Opt_WarnUnusedBinds
| Opt_WarnUnusedImports
| Opt_WarnUnusedMatches
| Opt_WarnWarningsDeprecations
| Opt_WarnDeprecatedFlags
| Opt_WarnDodgyImports
| Opt_WarnOrphans
| Opt_WarnTabs
| Opt_WarnUnrecognisedPragmas
| Opt_WarnDodgyForeignImports
| Opt_OverlappingInstances
| Opt_UndecidableInstances
| Opt_IncoherentInstances
| Opt_MonomorphismRestriction
| Opt_MonoPatBinds
| Opt_ExtendedDefaultRules
| Opt_ForeignFunctionInterface
| Opt_UnliftedFFITypes
| Opt_PArr
| Opt_Arrows
| Opt_TemplateHaskell
| Opt_QuasiQuotes
| Opt_ImplicitParams
| Opt_Generics
| Opt_ImplicitPrelude
| Opt_ScopedTypeVariables
| Opt_UnboxedTuples
| Opt_BangPatterns
| Opt_TypeFamilies
| Opt_OverloadedStrings
| Opt_DisambiguateRecordFields
| Opt_RecordWildCards
| Opt_RecordPuns
| Opt_ViewPatterns
| Opt_GADTs
| Opt_RelaxedPolyRec
| Opt_StandaloneDeriving
| Opt_DeriveDataTypeable
| Opt_TypeSynonymInstances
| Opt_FlexibleContexts
| Opt_FlexibleInstances
| Opt_ConstrainedClassMethods
| Opt_MultiParamTypeClasses
| Opt_FunctionalDependencies
| Opt_UnicodeSyntax
| Opt_PolymorphicComponents
| Opt_ExistentialQuantification
| Opt_MagicHash
| Opt_EmptyDataDecls
| Opt_KindSignatures
| Opt_ParallelListComp
| Opt_TransformListComp
| Opt_GeneralizedNewtypeDeriving
| Opt_RecursiveDo
| Opt_PostfixOperators
| Opt_PatternGuards
| Opt_LiberalTypeSynonyms
| Opt_Rank2Types
| Opt_RankNTypes
| Opt_ImpredicativeTypes
| Opt_TypeOperators
| Opt_PackageImports
| Opt_NewQualifiedOperators
| Opt_PrintExplicitForalls
| Opt_Strictness
| Opt_FullLaziness
| Opt_StaticArgumentTransformation
| Opt_CSE
| Opt_LiberateCase
| Opt_SpecConstr
| Opt_IgnoreInterfacePragmas
| Opt_OmitInterfacePragmas
| Opt_DoLambdaEtaExpansion
| Opt_IgnoreAsserts
| Opt_DoEtaReduction
| Opt_CaseMerge
| Opt_UnboxStrictFields
| Opt_MethodSharing
| Opt_DictsCheap
| Opt_InlineIfEnoughArgs
| Opt_EnableRewriteRules
| Opt_Vectorise
| Opt_RegsGraph
| Opt_RegsIterative
| Opt_Cpp
| Opt_Pp
| Opt_ForceRecomp
| Opt_DryRun
| Opt_DoAsmMangling
| Opt_ExcessPrecision
| Opt_ReadUserPackageConf
| Opt_NoHsMain
| Opt_SplitObjs
| Opt_StgStats
| Opt_HideAllPackages
| Opt_PrintBindResult
| Opt_Haddock
| Opt_HaddockOptions
| Opt_Hpc_No_Auto
| Opt_BreakOnException
| Opt_BreakOnError
| Opt_PrintEvldWithShow
| Opt_PrintBindContents
| Opt_GenManifest
| Opt_EmbedManifest
| Opt_RunCPSZ
| Opt_ConvertToZipCfgAndBack
| Opt_AutoLinkPackages
| Opt_ImplicitImportQualified
| Opt_KeepHiDiffs
| Opt_KeepHcFiles
| Opt_KeepSFiles
| Opt_KeepRawSFiles
| Opt_KeepTmpFiles
| Opt_KeepRawTokenStream

data DynFlags = DynFlags {

ghcMode :: GhcMode
ghcLink :: GhcLink
coreToDo :: Maybe [CoreToDo]
stgToDo :: Maybe [StgToDo]
hscTarget :: HscTarget
hscOutName :: String
extCoreName :: String
verbosity :: Int
optLevel :: Int
simplPhases :: Int
maxSimplIterations :: Int
shouldDumpSimplPhase :: SimplifierMode -> Bool
ruleCheck :: Maybe String
specConstrThreshold :: Maybe Int
specConstrCount :: Maybe Int
liberateCaseThreshold :: Maybe Int
stolen_x86_regs :: Int
cmdlineHcIncludes :: [String]
importPaths :: [FilePath]
mainModIs :: Module
mainFunIs :: Maybe String
ctxtStkDepth :: Int
dphBackend :: DPHBackend
thisPackage :: PackageId
wayNames :: [WayName]
buildTag :: String
rtsBuildTag :: String
objectDir :: Maybe String
hiDir :: Maybe String
stubDir :: Maybe String
objectSuf :: String
hcSuf :: String
hiSuf :: String
outputFile :: Maybe String
outputHi :: Maybe String
dynLibLoader :: DynLibLoader
dumpPrefix :: Maybe FilePath
dumpPrefixForce :: Maybe FilePath
includePaths :: [String]
libraryPaths :: [String]
frameworkPaths :: [String]
cmdlineFrameworks :: [String]
tmpDir :: String
ghcUsagePath :: FilePath
ghciUsagePath :: FilePath
hpcDir :: String
opt_L :: [String]
opt_P :: [String]
opt_F :: [String]
opt_c :: [String]
opt_m :: [String]
opt_a :: [String]
opt_l :: [String]
opt_windres :: [String]
pgm_L :: String
pgm_P :: (String, [Option])
pgm_F :: String
pgm_c :: (String, [Option])
pgm_m :: (String, [Option])
pgm_s :: (String, [Option])
pgm_a :: (String, [Option])
pgm_l :: (String, [Option])
pgm_dll :: (String, [Option])
pgm_T :: String
pgm_sysman :: String
pgm_windres :: String
depMakefile :: FilePath
depIncludePkgDeps :: Bool
depExcludeMods :: [ModuleName]
depSuffixes :: [String]
extraPkgConfs :: [FilePath]
topDir :: FilePath
systemPackageConfig :: FilePath
packageFlags :: [PackageFlag]
pkgDatabase :: Maybe (UniqFM PackageConfig)
pkgState :: PackageState
flags :: [DynFlag]
log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO ()
haddockOptions :: Maybe String

}

data HscTarget

= HscC
| HscAsm
| HscJava
| HscInterpreted
| HscNothing

isObjectTarget :: HscTarget -> Bool
defaultObjectTarget :: HscTarget

data GhcMode

= CompManager
| OneShot
| MkDepend

isOneShot :: GhcMode -> Bool

data GhcLink

= NoLink
| LinkBinary
| LinkInMemory
| LinkDynLib

isNoLink :: GhcLink -> Bool

data PackageFlag

= ExposePackage String
| HidePackage String
| IgnorePackage String

data Option

= FileOption String String
| Option String

data DynLibLoader

= Deployable
| Wrapped (Maybe String)
| SystemDependent

fFlags :: [(String, DynFlag, Bool -> Deprecated)]
xFlags :: [(String, DynFlag, Bool -> Deprecated)]
dphPackage :: DynFlags -> PackageId
defaultDynFlags :: DynFlags
initDynFlags :: DynFlags -> IO DynFlags
dopt :: DynFlag -> DynFlags -> Bool
dopt_set :: DynFlags -> DynFlag -> DynFlags
dopt_unset :: DynFlags -> DynFlag -> DynFlags
getOpts :: DynFlags -> (DynFlags -> [a]) -> [a]
getVerbFlag :: DynFlags -> String
getMainFun :: DynFlags -> RdrName
updOptLevel :: Int -> DynFlags -> DynFlags
setTmpDir :: FilePath -> DynFlags -> DynFlags
setPackageName :: String -> DynFlags -> DynFlags
parseDynamicFlags :: Monad m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Located String])
parseDynamicNoPackageFlags :: Monad m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Located String])
allFlags :: [String]
supportedLanguages :: [String]
languageOptions :: [DynFlag]
machdepCCOpts :: DynFlags -> ([String], [String])
picCCOpts :: DynFlags -> [String]

data CoreToDo

= CoreDoSimplify SimplifierMode [SimplifierSwitch]
| CoreDoFloatInwards
| CoreDoFloatOutwards FloatOutSwitches
| CoreLiberateCase
| CoreDoPrintCore
| CoreDoStaticArgs
| CoreDoStrictness
| CoreDoWorkerWrapper
| CoreDoSpecialising
| CoreDoSpecConstr
| CoreDoOldStrictness
| CoreDoGlomBinds
| CoreCSE
| CoreDoRuleCheck Int String
| CoreDoVectorisation PackageId
| CoreDoNothing
| CoreDoPasses [CoreToDo]

data SimplifierMode

= SimplGently
| SimplPhase Int [String]

data SimplifierSwitch

= MaxSimplifierIterations Int
| NoCaseOfCase

data FloatOutSwitches = FloatOutSw Bool Bool
getCoreToDo :: DynFlags -> [CoreToDo]

data StgToDo

= StgDoMassageForProfiling
| D_stg_stats

getStgToDo :: DynFlags -> [StgToDo]
compilerInfo :: [(String, String)]

Dynamic flags and associated configuration types
data DynFlag

Enumerates the simple on-or-off dynamic flags
Constructors

Opt_D_dump_cmm |
Opt_D_dump_cmmz |
Opt_D_dump_cmmz_pretty |
Opt_D_dump_cps_cmm |
Opt_D_dump_cvt_cmm |
Opt_D_dump_asm |
Opt_D_dump_asm_native |
Opt_D_dump_asm_liveness |
Opt_D_dump_asm_coalesce |
Opt_D_dump_asm_regalloc |
Opt_D_dump_asm_regalloc_stages |
Opt_D_dump_asm_conflicts |
Opt_D_dump_asm_stats |
Opt_D_dump_cpranal |
Opt_D_dump_deriv |
Opt_D_dump_ds |
Opt_D_dump_flatC |
Opt_D_dump_foreign |
Opt_D_dump_inlinings |
Opt_D_dump_rule_firings |
Opt_D_dump_occur_anal |
Opt_D_dump_parsed |
Opt_D_dump_rn |
Opt_D_dump_simpl |
Opt_D_dump_simpl_iterations |
Opt_D_dump_simpl_phases |
Opt_D_dump_spec |
Opt_D_dump_prep |
Opt_D_dump_stg |
Opt_D_dump_stranal |
Opt_D_dump_tc |
Opt_D_dump_types |
Opt_D_dump_rules |
Opt_D_dump_cse |
Opt_D_dump_worker_wrapper |
Opt_D_dump_rn_trace |
Opt_D_dump_rn_stats |
Opt_D_dump_opt_cmm |
Opt_D_dump_simpl_stats |
Opt_D_dump_tc_trace |
Opt_D_dump_if_trace |
Opt_D_dump_splices |
Opt_D_dump_BCOs |
Opt_D_dump_vect |
Opt_D_dump_hpc |
Opt_D_dump_rtti |
Opt_D_source_stats |
Opt_D_verbose_core2core |
Opt_D_verbose_stg2stg |
Opt_D_dump_hi |
Opt_D_dump_hi_diffs |
Opt_D_dump_minimal_imports |
Opt_D_dump_mod_cycles |
Opt_D_dump_view_pattern_commoning |
Opt_D_faststring_stats |
Opt_DumpToFile | Append dump output to files instead of stdout.
Opt_D_no_debug_output |
Opt_DoCoreLinting |
Opt_DoStgLinting |
Opt_DoCmmLinting |
Opt_DoAsmLinting |
Opt_WarnIsError |
Opt_WarnDuplicateExports |
Opt_WarnHiShadows |
Opt_WarnImplicitPrelude |
Opt_WarnIncompletePatterns |
Opt_WarnIncompletePatternsRecUpd |
Opt_WarnMissingFields |
Opt_WarnMissingMethods |
Opt_WarnMissingSigs |
Opt_WarnNameShadowing |
Opt_WarnOverlappingPatterns |
Opt_WarnSimplePatterns |
Opt_WarnTypeDefaults |
Opt_WarnMonomorphism |
Opt_WarnUnusedBinds |
Opt_WarnUnusedImports |
Opt_WarnUnusedMatches |
Opt_WarnWarningsDeprecations |
Opt_WarnDeprecatedFlags |
Opt_WarnDodgyImports |
Opt_WarnOrphans |
Opt_WarnTabs |
Opt_WarnUnrecognisedPragmas |
Opt_WarnDodgyForeignImports |
Opt_OverlappingInstances |
Opt_UndecidableInstances |
Opt_IncoherentInstances |
Opt_MonomorphismRestriction |
Opt_MonoPatBinds |
Opt_ExtendedDefaultRules |
Opt_ForeignFunctionInterface |
Opt_UnliftedFFITypes |
Opt_PArr |
Opt_Arrows |
Opt_TemplateHaskell |
Opt_QuasiQuotes |
Opt_ImplicitParams |
Opt_Generics |
Opt_ImplicitPrelude |
Opt_ScopedTypeVariables |
Opt_UnboxedTuples |
Opt_BangPatterns |
Opt_TypeFamilies |
Opt_OverloadedStrings |
Opt_DisambiguateRecordFields |
Opt_RecordWildCards |
Opt_RecordPuns |
Opt_ViewPatterns |
Opt_GADTs |
Opt_RelaxedPolyRec |
Opt_StandaloneDeriving |
Opt_DeriveDataTypeable |
Opt_TypeSynonymInstances |
Opt_FlexibleContexts |
Opt_FlexibleInstances |
Opt_ConstrainedClassMethods |
Opt_MultiParamTypeClasses |
Opt_FunctionalDependencies |
Opt_UnicodeSyntax |
Opt_PolymorphicComponents |
Opt_ExistentialQuantification |
Opt_MagicHash |
Opt_EmptyDataDecls |
Opt_KindSignatures |
Opt_ParallelListComp |
Opt_TransformListComp |
Opt_GeneralizedNewtypeDeriving |
Opt_RecursiveDo |
Opt_PostfixOperators |
Opt_PatternGuards |
Opt_LiberalTypeSynonyms |
Opt_Rank2Types |
Opt_RankNTypes |
Opt_ImpredicativeTypes |
Opt_TypeOperators |
Opt_PackageImports |
Opt_NewQualifiedOperators |
Opt_PrintExplicitForalls |
Opt_Strictness |
Opt_FullLaziness |
Opt_StaticArgumentTransformation |
Opt_CSE |
Opt_LiberateCase |
Opt_SpecConstr |
Opt_IgnoreInterfacePragmas |
Opt_OmitInterfacePragmas |
Opt_DoLambdaEtaExpansion |
Opt_IgnoreAsserts |
Opt_DoEtaReduction |
Opt_CaseMerge |
Opt_UnboxStrictFields |
Opt_MethodSharing |
Opt_DictsCheap |
Opt_InlineIfEnoughArgs |
Opt_EnableRewriteRules |
Opt_Vectorise |
Opt_RegsGraph |
Opt_RegsIterative |
Opt_Cpp |
Opt_Pp |
Opt_ForceRecomp |
Opt_DryRun |
Opt_DoAsmMangling |
Opt_ExcessPrecision |
Opt_ReadUserPackageConf |
Opt_NoHsMain |
Opt_SplitObjs |
Opt_StgStats |
Opt_HideAllPackages |
Opt_PrintBindResult |
Opt_Haddock |
Opt_HaddockOptions |
Opt_Hpc_No_Auto |
Opt_BreakOnException |
Opt_BreakOnError |
Opt_PrintEvldWithShow |
Opt_PrintBindContents |
Opt_GenManifest |
Opt_EmbedManifest |
Opt_RunCPSZ |
Opt_ConvertToZipCfgAndBack |
Opt_AutoLinkPackages |
Opt_ImplicitImportQualified |
Opt_KeepHiDiffs |
Opt_KeepHcFiles |
Opt_KeepSFiles |
Opt_KeepRawSFiles |
Opt_KeepTmpFiles |
Opt_KeepRawTokenStream |

Instances

Eq DynFlag
Show DynFlag

data DynFlags

Contains not only a collection of `DynFlag`s but also a plethora of information relating to the compilation of a single file or GHC session
Constructors

DynFlags |

ghcMode :: GhcMode |
ghcLink :: GhcLink |
coreToDo :: Maybe [CoreToDo] |
stgToDo :: Maybe [StgToDo] |
hscTarget :: HscTarget |
hscOutName :: String | Name of the output file
extCoreName :: String | Name of the .hcr output file
verbosity :: Int | Verbosity level: see DynFlags
optLevel :: Int | Optimisation level
simplPhases :: Int | Number of simplifier phases
maxSimplIterations :: Int | Max simplifier iterations
shouldDumpSimplPhase :: SimplifierMode -> Bool |
ruleCheck :: Maybe String |
specConstrThreshold :: Maybe Int | Threshold for SpecConstr
specConstrCount :: Maybe Int | Max number of specialisations for any one function
liberateCaseThreshold :: Maybe Int | Threshold for LiberateCase
stolen_x86_regs :: Int |

cmdlineHcIncludes :: [String]

    -#includes

importPaths :: [FilePath] |
mainModIs :: Module |
mainFunIs :: Maybe String |
ctxtStkDepth :: Int | Typechecker context stack depth
dphBackend :: DPHBackend |
thisPackage :: PackageId | name of package currently being compiled
wayNames :: [WayName] | Way flags from the command line
buildTag :: String | The global "way" (e.g. "p" for prof)
rtsBuildTag :: String | The RTS "way"
objectDir :: Maybe String |
hiDir :: Maybe String |
stubDir :: Maybe String |
objectSuf :: String |
hcSuf :: String |
hiSuf :: String |
outputFile :: Maybe String |
outputHi :: Maybe String |
dynLibLoader :: DynLibLoader |
dumpPrefix :: Maybe FilePath | This is set by DriverPipeline.runPipeline based on where its output is going.
dumpPrefixForce :: Maybe FilePath | Override the `dumpPrefix` set by DriverPipeline.runPipeline. Set by `-ddump-file-prefix`
includePaths :: [String] |
libraryPaths :: [String] |
frameworkPaths :: [String] |
cmdlineFrameworks :: [String] |
tmpDir :: String |
ghcUsagePath :: FilePath |
ghciUsagePath :: FilePath |
hpcDir :: String | Path to store the .mix files
opt_L :: [String] |
opt_P :: [String] |
opt_F :: [String] |
opt_c :: [String] |
opt_m :: [String] |
opt_a :: [String] |
opt_l :: [String] |
opt_windres :: [String] |
pgm_L :: String |
pgm_P :: (String, [Option]) |
pgm_F :: String |
pgm_c :: (String, [Option]) |
pgm_m :: (String, [Option]) |
pgm_s :: (String, [Option]) |
pgm_a :: (String, [Option]) |
pgm_l :: (String, [Option]) |
pgm_dll :: (String, [Option]) |
pgm_T :: String |
pgm_sysman :: String |
pgm_windres :: String |
depMakefile :: FilePath |
depIncludePkgDeps :: Bool |
depExcludeMods :: [ModuleName] |
depSuffixes :: [String] |
extraPkgConfs :: [FilePath] |
topDir :: FilePath |
systemPackageConfig :: FilePath | The `-package-conf` flags given on the command line, in the order they appeared.
packageFlags :: [PackageFlag] | The `-package` and `-hide-package` flags from the command-line
pkgDatabase :: Maybe (UniqFM PackageConfig) |
pkgState :: PackageState |
flags :: [DynFlag] |
log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO () | Message output action: use ErrUtils instead of this if you can
haddockOptions :: Maybe String |

data HscTarget

The target code type of the compilation (if any).

`HscNothing` can be used to avoid generating any output, however, note that:

- This will not run the desugaring step, thus no warnings generated in this step will be output. In particular, this includes warnings related to pattern matching.
- At the moment switching from `HscNothing` to `HscInterpreted` without unloading first is not safe. To unload use `GHC.setTargets [] >> GHC.load LoadAllTargets`.

Constructors

HscC |
HscAsm |
HscJava |
HscInterpreted |
HscNothing |

Instances

Eq HscTarget
Show HscTarget

isObjectTarget :: HscTarget -> Bool
Will this target result in an object file on the disk?
defaultObjectTarget :: HscTarget
The `HscTarget` value corresponding to the default way to create object files on the current platform.
data GhcMode

The `GhcMode` tells us whether we're doing multi-module compilation (controlled via the GHC API) or one-shot (single-module) compilation. This makes a difference primarily to the Finder: in one-shot mode we look for interface files for imported modules, but in multi-module mode we look for source files in order to check whether they need to be recompiled.
Constructors

CompManager | `--make`, GHCi, etc.

OneShot

    ghc -c Foo.hs

MkDepend | `ghc -M`, see Finder for why we need this

Instances

Eq GhcMode
Outputable GhcMode

isOneShot :: GhcMode -> Bool
data GhcLink

What to do in the link step, if there is one.
Constructors

NoLink | Don't link at all
LinkBinary | Link object code into a binary
LinkInMemory | Use the in-memory dynamic linker
LinkDynLib | Link objects into a dynamic lib (DLL on Windows, DSO on ELF platforms)

Instances

Eq GhcLink
Show GhcLink

isNoLink :: GhcLink -> Bool
data PackageFlag

Constructors

ExposePackage String |
HidePackage String |
IgnorePackage String |

Instances

Eq PackageFlag

data Option

When invoking external tools as part of the compilation pipeline, we pass these a sequence of options on the command-line. Rather than just using a list of Strings, we use a type that allows us to distinguish between filepaths and 'other stuff'. The reason for this is that this type gives us a handle on transforming filenames, and filenames only, to whatever format they're expected to be on a particular platform.

Constructors

FileOption String String |
Option String |

data DynLibLoader

Constructors

Deployable |
Wrapped (Maybe String) |
SystemDependent |

Instances

Eq DynLibLoader

fFlags :: [(String, DynFlag, Bool -> Deprecated)]
These `-f<blah>` flags can all be reversed with `-fno-<blah>`
xFlags :: [(String, DynFlag, Bool -> Deprecated)]
These -Xblah> flags can all be reversed with -XNo<blah
dphPackage :: DynFlags -> PackageId
Manipulating DynFlags
defaultDynFlags :: DynFlags
The normal `DynFlags`. Note that they is not suitable for use in this form and must be fully initialized by GHC.newSession first.
initDynFlags :: DynFlags -> IO DynFlags
Used by GHC.newSession to partially initialize a new `DynFlags` value
dopt :: DynFlag -> DynFlags -> Bool
Test whether a `DynFlag` is set
dopt_set :: DynFlags -> DynFlag -> DynFlags
Set a `DynFlag`
dopt_unset :: DynFlags -> DynFlag -> DynFlags
Unset a `DynFlag`
getOpts

:: |
=> DynFlags | `DynFlags` to retrieve the options from
-> DynFlags -> [a] | Relevant record accessor: one of the `opt_*` accessors
-> [a] | Correctly ordered extracted options
Retrieve the options corresponding to a particular `opt_*` field in the correct order

getVerbFlag :: DynFlags -> String
Gets the verbosity flag for the current verbosity level. This is fed to other tools, so GHC-specific verbosity flags like `-ddump-most` are not included
getMainFun :: DynFlags -> RdrName
Get the unqualified name of the function to use as the "main" for the main module. Either returns the default name or the one configured on the command line with -main-is
updOptLevel :: Int -> DynFlags -> DynFlags
Sets the `DynFlags` to be appropriate to the optimisation level
setTmpDir :: FilePath -> DynFlags -> DynFlags
setPackageName :: String -> DynFlags -> DynFlags
Parsing DynFlags
parseDynamicFlags

:: Monad m |
=> DynFlags |
-> [Located String] |
-> m (DynFlags, [Located String], [Located String]) | Updated `DynFlags`, left-over arguments, and list of warnings.
Parse dynamic flags from a list of command line arguments. Returns the the parsed `DynFlags`, the left-over arguments, and a list of warnings. Throws a `UsageError` if errors occurred during parsing (such as unknown flags or missing arguments).

parseDynamicNoPackageFlags

:: Monad m |
=> DynFlags |
-> [Located String] |
-> m (DynFlags, [Located String], [Located String]) | Updated `DynFlags`, left-over arguments, and list of warnings.
Like `parseDynamicFlags` but does not allow the package flags (-package, -hide-package, -ignore-package, -hide-all-packages, -package-conf).

allFlags :: [String]
supportedLanguages :: [String]
languageOptions :: [DynFlag]
DynFlag C compiler options
machdepCCOpts :: DynFlags -> ([String], [String])
picCCOpts :: DynFlags -> [String]
Configuration of the core-to-core passes
data CoreToDo

Constructors

CoreDoSimplify SimplifierMode [SimplifierSwitch] |
CoreDoFloatInwards |
CoreDoFloatOutwards FloatOutSwitches |
CoreLiberateCase |
CoreDoPrintCore |
CoreDoStaticArgs |
CoreDoStrictness |
CoreDoWorkerWrapper |
CoreDoSpecialising |
CoreDoSpecConstr |
CoreDoOldStrictness |
CoreDoGlomBinds |
CoreCSE |
CoreDoRuleCheck Int String |
CoreDoVectorisation PackageId |
CoreDoNothing |
CoreDoPasses [CoreToDo] |

data SimplifierMode

Constructors

SimplGently |
SimplPhase Int [String] |

data SimplifierSwitch

Constructors

MaxSimplifierIterations Int |
NoCaseOfCase |

Instances

Eq SimplifierSwitch
Ord SimplifierSwitch

data FloatOutSwitches

Constructors

FloatOutSw Bool Bool |

getCoreToDo :: DynFlags -> [CoreToDo]
Configuration of the stg-to-stg passes
data StgToDo

Constructors

StgDoMassageForProfiling |
D_stg_stats |

getStgToDo :: DynFlags -> [StgToDo]
Compiler configuration suitable for display to the user
compilerInfo :: [(String, String)]
Produced by Haddock version 2.4.2