GHC.Driver.Pipeline
Run a series of compilation steps in a pipeline, for a
Interfaces for the compilation manager (interpreted/batch-mode)
Arguments
:: HscEnv | |
-> FilePath | input filename |
-> Maybe InputFileBuffer | optional buffer to use instead of reading the input file |
-> Maybe Phase | starting phase |
-> IO (Either DriverMessages (DynFlags, FilePath)) |
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
Arguments
:: HscEnv | |
-> ModSummary | summary for module being compiled |
-> Int | module N ... |
-> Int | ... of M |
-> Maybe ModIface | old interface, if we have one |
-> Maybe Linkable | old linkable, if we have one |
-> IO HomeModInfo | the 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.
compileForeign :: HscEnv -> ForeignSrcLang -> FilePath -> IO FilePath Source #
compileEmptyStub :: DynFlags -> HscEnv -> FilePath -> ModLocation -> ModuleName -> IO () Source #
Linking
Arguments
:: GhcLink | interactive or batch |
-> Logger | Logger |
-> TmpFs | |
-> Hooks | |
-> DynFlags | dynamic flags |
-> UnitEnv | unit environment |
-> Bool | attempt linking in batch mode? |
-> Maybe (RecompileRequired -> IO ()) | |
-> HomePackageTable | what to link |
-> IO SuccessFlag |
linkingNeeded :: Logger -> DynFlags -> UnitEnv -> Bool -> [Linkable] -> [UnitId] -> IO RecompileRequired Source #
PipeEnv
Constructors
PipeEnv | |
Fields
|
Running individual phases
data TPhase res where Source #
Constructors
hscPostBackendPhase :: HscSource -> Backend -> Phase Source #
What phase to run after one of the backend code generators has run
Constructing Pipelines
type TPipelineClass (f :: Type -> Type) (m :: Type -> Type) = (Functor m, MonadIO m, Applicative m, Monad m, MonadUse f m) Source #
preprocessPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> m (DynFlags, FilePath) Source #
The preprocessor pipeline
fullPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> HscSource -> m (ModIface, Maybe Linkable) Source #
The complete compilation pipeline, from start to finish
hscPipeline :: P m => PipeEnv -> (HscEnv, ModSummary, HscRecompStatus) -> m (ModIface, Maybe Linkable) Source #
Everything after preprocess
hscBackendPipeline :: P m => PipeEnv -> HscEnv -> ModSummary -> HscBackendAction -> m (ModIface, Maybe Linkable) Source #
hscPostBackendPipeline :: P m => PipeEnv -> HscEnv -> HscSource -> Backend -> Maybe ModLocation -> FilePath -> m (Maybe FilePath) Source #
hscGenBackendPipeline :: P m => PipeEnv -> HscEnv -> ModSummary -> HscBackendAction -> m (ModIface, Maybe Linkable) Source #
asPipeline :: P m => Bool -> PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m (Maybe ObjFile) Source #
viaCPipeline :: P m => Phase -> PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m (Maybe FilePath) Source #
llvmPipeline :: P m => PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m (Maybe FilePath) Source #
llvmLlcPipeline :: P m => PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m (Maybe FilePath) Source #
llvmManglePipeline :: P m => PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m (Maybe FilePath) Source #