Moduleghc-9.10.3GHC2021
GHC.Driver.Pipeline
- 3 types
- 1 class
- 30 values
- Packageghc-9.10.3
- Exports34
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourcePipeline.hs
Run a series of compilation steps in a pipeline, for a
2 declarationsInterfaces for the compilation manager (interpreted/batch-mode)
5 declarationspreprocess Just preprocess a file, put the result in a temp. file (used by the compilation manager during the summary phase).
We return the augmented DynFlags, because they contain the result of slurping in the OPTIONS pragmas
compileOne :: HscEnv-> ModSummarysummary for module being compiled
-> Intmodule N ...
-> Int... of M
-> Maybe ModIfaceold interface, if we have one
-> HomeModLinkableold linkable, if we have one
-> IO HomeModInfothe complete HomeModInfo, if successful
Compile
Compile a single module, under the control of the compilation manager.
This is the interface between the compilation manager and the compiler proper (hsc), where we deal with tedious details like reading the OPTIONS pragma from the source file, converting the C or assembly that GHC produces into an object file, and compiling FFI stub files.
NB. No old interface can also mean that the source has changed.
compileOne' :: Maybe Messager-> HscEnv-> ModSummarysummary for module being compiled
-> Intmodule N ...
-> Int... of M
-> Maybe ModIfaceold interface, if we have one
-> HomeModLinkable-> IO HomeModInfothe complete HomeModInfo, if successful
Linking
3 declarationslink :: GhcLinkinteractive or batch
-> LoggerLogger
-> TmpFs-> FinderCache-> Hooks-> DynFlagsdynamic flags
-> UnitEnvunit environment
-> Boolattempt linking in batch mode?
-> Maybe (RecompileRequired -> IO ())-> HomePackageTablewhat to link
-> IO SuccessFlag
PipeEnv
3 declarationsConstructors
PipeEnvstop_phase :: StopPhaseStop just after this phase
src_filename :: Stringbasename of original input source
src_basename :: Stringbasename of original input source
src_suffix :: Stringits extension
start_phase :: Phaseoutput_spec :: PipelineOutputsays where to put the pipeline output
Running individual phases
3 declarationsConstructors
T_Unlit :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_FileArgs :: HscEnv -> FilePath -> TPhase (DynFlags, Messages PsMessage, Messages DriverMessage)T_Cpp :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_HsPp :: PipeEnv -> HscEnv -> FilePath -> FilePath -> TPhase [Char]T_HscRecomp :: PipeEnv -> HscEnv -> FilePath -> HscSource -> TPhase (HscEnv, ModSummary, HscRecompStatus)T_Hsc :: HscEnv -> ModSummary -> TPhase (FrontendResult, Messages GhcMessage)T_HscPostTc :: HscEnv -> ModSummary -> FrontendResult -> Messages GhcMessage -> Maybe Fingerprint -> TPhase HscBackendActionT_HscBackend :: PipeEnv -> HscEnv -> ModuleName -> HscSource -> ModLocation -> HscBackendAction -> TPhase ([FilePath], ModIface, HomeModLinkable, FilePath)T_CmmCpp :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_Cmm :: PipeEnv -> HscEnv -> FilePath -> TPhase ([FilePath], FilePath)T_Cc :: Phase -> PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> TPhase [Char]T_As :: Bool -> PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> TPhase [Char]T_Js :: PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> TPhase [Char]T_ForeignJs :: PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> TPhase [Char]T_LlvmOpt :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_LlvmLlc :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_LlvmAs :: Bool -> PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> TPhase [Char]T_LlvmMangle :: PipeEnv -> HscEnv -> FilePath -> TPhase [Char]T_MergeForeign :: PipeEnv -> HscEnv -> FilePath -> [FilePath] -> TPhase [Char]
Default interpretation of each phase, in terms of IO.
What phase to run after one of the backend code generators has run
Constructing Pipelines
17 declarationsLift a f action into an m action.
Methods
use :: f a -> m a
The preprocessor pipeline
The complete compilation pipeline, from start to finish
Everything after preprocess
Default method of running a pipeline
1 declarationThe default mechanism to run a pipeline, see Note [The Pipeline Monad]