ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

DriverPhases

Synopsis

- data HscSource
  - = HsSrcFile
  - | HsBootFile
  - | HsigFile
- isHsBootOrSig :: HscSource -> Bool
- hscSourceString :: HscSource -> String
- data Phase
  - = Unlit HscSource
  - | Cpp HscSource
  - | HsPp HscSource
  - | Hsc HscSource
  - | Ccxx
  - | Cc
  - | Cobjc
  - | Cobjcxx
  - | HCc
  - | Splitter
  - | SplitAs
  - | As Bool
  - | LlvmOpt
  - | LlvmLlc
  - | LlvmMangle
  - | CmmCpp
  - | Cmm
  - | MergeForeign
  - | StopLn
- happensBefore :: DynFlags -> Phase -> Phase -> Bool
- eqPhase :: Phase -> Phase -> Bool
- anyHsc :: Phase
- isStopLn :: Phase -> Bool
- startPhase :: String -> Phase
- phaseInputExt :: Phase -> String
- 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
- 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

# Documentation

data HscSource #

Constructors

HsSrcFile |
HsBootFile |
HsigFile |

Instances

Eq HscSource # |
Methods (==) :: HscSource -> HscSource -> Bool # (/=) :: HscSource -> HscSource -> Bool #
Ord HscSource # |
Methods compare :: HscSource -> HscSource -> Ordering # (<) :: HscSource -> HscSource -> Bool # (<=) :: HscSource -> HscSource -> Bool # (>) :: HscSource -> HscSource -> Bool # (>=) :: HscSource -> HscSource -> Bool # max :: HscSource -> HscSource -> HscSource # min :: HscSource -> HscSource -> HscSource #
Show HscSource # |
Methods showsPrec :: Int -> HscSource -> ShowS Source # show :: HscSource -> String Source # showList :: [HscSource] -> ShowS Source #
Binary HscSource # |
Methods put_ :: BinHandle -> HscSource -> IO () # put :: BinHandle -> HscSource -> IO (Bin * HscSource) # get :: BinHandle -> IO HscSource #

isHsBootOrSig :: HscSource -> Bool #

hscSourceString :: HscSource -> String #

data Phase #

Constructors

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

Instances

Eq Phase # |
Methods (==) :: Phase -> Phase -> Bool # (/=) :: Phase -> Phase -> Bool #
Show Phase # |
Methods showsPrec :: Int -> Phase -> ShowS Source # show :: Phase -> String Source # showList :: [Phase] -> ShowS Source #
Outputable Phase # |
Methods ppr :: Phase -> SDoc # pprPrec :: Rational -> Phase -> SDoc #

happensBefore :: DynFlags -> Phase -> Phase -> Bool #

eqPhase :: Phase -> Phase -> Bool #

anyHsc :: Phase #

isStopLn :: Phase -> Bool #

startPhase :: String -> Phase #

phaseInputExt :: Phase -> String #

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 #

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 #