GHC.Driver.Phases

ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Driver.Phases

Synopsis

- data Phase
  - = Unlit HscSource
  - | Cpp HscSource
  - | HsPp HscSource
  - | Hsc HscSource
  - | Ccxx
  - | Cc
  - | Cobjc
  - | Cobjcxx
  - | HCc
  - | As Bool
  - | LlvmOpt
  - | LlvmLlc
  - | LlvmMangle
  - | CmmCpp
  - | Cmm
  - | MergeForeign
  - | Js
  - | StopLn
- happensBefore :: Platform -> Phase -> Phase -> Bool
- eqPhase :: Phase -> Phase -> Bool
- isStopLn :: Phase -> Bool
- startPhase :: String -> Phase
- phaseInputExt :: Phase -> String
- data StopPhase
  - = StopPreprocess
  - | StopC
  - | StopAs
  - | NoStop
- stopPhaseToPhase :: StopPhase -> Phase
- isHaskellishSuffix :: String -> Bool
- isHaskellSrcSuffix :: String -> Bool
- isBackpackishSuffix :: String -> Bool
- isObjectSuffix :: Platform -> String -> Bool
- isCishSuffix :: String -> Bool
- isDynLibSuffix :: Platform -> String -> Bool
- isHaskellUserSrcSuffix :: String -> Bool
- isHaskellSigSuffix :: String -> Bool
- isHaskellBootSuffix :: String -> Bool
- isSourceSuffix :: String -> Bool
- isHaskellishTarget :: (String, Maybe Phase) -> Bool
- isHaskellishFilename :: FilePath -> Bool
- isHaskellSrcFilename :: FilePath -> Bool
- isHaskellSigFilename :: FilePath -> Bool
- isObjectFilename :: Platform -> FilePath -> Bool
- isCishFilename :: FilePath -> Bool
- isDynLibFilename :: Platform -> FilePath -> Bool
- isHaskellUserSrcFilename :: FilePath -> Bool
- isSourceFilename :: FilePath -> Bool
- phaseForeignLanguage :: Phase -> Maybe ForeignSrcLang

# Documentation

data Phase #

Untyped Phase description

Constructors

Unlit HscSource |
Cpp HscSource |
HsPp HscSource |
Hsc HscSource |
Ccxx |
Cc |
Cobjc |
Cobjcxx |
HCc |
As Bool |
LlvmOpt |
LlvmLlc |
LlvmMangle |
CmmCpp |
Cmm |
MergeForeign |
Js |
StopLn |

#### Instances

Instances details

Show Phase # |
Instance details Defined in GHC.Driver.Phases Methods showsPrec :: Int -> Phase -> ShowS # show :: Phase -> String # showList :: [Phase] -> ShowS #
Outputable Phase # |
Instance details Defined in GHC.Driver.Phases Methods ppr :: Phase -> SDoc #
Eq Phase # |
Instance details Defined in GHC.Driver.Phases Methods (==) :: Phase -> Phase -> Bool # (/=) :: Phase -> Phase -> Bool #

happensBefore :: Platform -> Phase -> Phase -> Bool #

eqPhase :: Phase -> Phase -> Bool #

isStopLn :: Phase -> Bool #

startPhase :: String -> Phase #

phaseInputExt :: Phase -> String #

data StopPhase #

Constructors

StopPreprocess |
    -E
StopC |
    -C
StopAs |
    -S
NoStop |
    -c

stopPhaseToPhase :: StopPhase -> Phase #

isHaskellishSuffix :: String -> Bool #

isHaskellSrcSuffix :: String -> Bool #

isBackpackishSuffix :: String -> Bool #

isObjectSuffix :: Platform -> String -> Bool #

isCishSuffix :: String -> Bool #

isDynLibSuffix :: Platform -> String -> Bool #

isHaskellUserSrcSuffix :: String -> Bool #

isHaskellSigSuffix :: String -> Bool #

isHaskellBootSuffix :: String -> Bool #

isSourceSuffix :: String -> Bool #

isHaskellishTarget :: (String, Maybe Phase) -> Bool #

When we are given files (modified by -x arguments) we need to determine if they are Haskellish or not to figure out how we should try to compile it. The rules are:

1. If no -x flag was specified, we check to see if the file looks like a module name, has no extension, or has a Haskell source extension.
2. If an -x flag was specified, we just make sure the specified suffix is a Haskell one.

isHaskellishFilename :: FilePath -> Bool #

isHaskellSrcFilename :: FilePath -> Bool #

isHaskellSigFilename :: FilePath -> Bool #

isObjectFilename :: Platform -> FilePath -> Bool #

isCishFilename :: FilePath -> Bool #

isDynLibFilename :: Platform -> FilePath -> Bool #

isHaskellUserSrcFilename :: FilePath -> Bool #

isSourceFilename :: FilePath -> Bool #

phaseForeignLanguage :: Phase -> Maybe ForeignSrcLang #

Foreign language of the phase if the phase deals with a foreign code