ghc-7.10.1: The GHC API

Safe HaskellNone
LanguageHaskell2010

PipelineMonad

Description

The CompPipeline monad and associated ops

Defined in separate module so that it can safely be imported from Hooks

Documentation

data PipeEnv Source

Constructors

PipeEnv 

Fields

pe_isHaskellishFile :: Bool
 
stop_phase :: Phase

Stop just before this phase

src_filename :: String

basename of original input source

src_basename :: String

basename of original input source

src_suffix :: String

its extension

output_spec :: PipelineOutput

says where to put the pipeline output

data PipeState Source

Constructors

PipeState 

Fields

hsc_env :: HscEnv

only the DynFlags change in the HscEnv. The DynFlags change at various points, for example when we read the OPTIONS_GHC pragmas in the Cpp phase.

maybe_loc :: Maybe ModLocation

the ModLocation. This is discovered during compilation, in the Hsc phase where we read the module header.

maybe_stub_o :: Maybe FilePath

the stub object. This is set by the Hsc phase if a stub object was created. The stub object will be joined with the main compilation object using "ld -r" at the end.

data PipelineOutput Source

Constructors

Temporary

Output should be to a temporary file: we're going to run more compilation steps on this output later.

Persistent

We want a persistent file, i.e. a file in the current directory derived from the input filename, but with the appropriate extension. eg. in "ghc -c Foo.hs" the output goes into ./Foo.o.

SpecificFile

The output must go into the specific outputFile in DynFlags. We don't store the filename in the constructor as it changes when doing -dynamic-too.

Instances