GHC.SysTools.Cpp

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.SysTools.Cpp

Synopsis

- doCpp :: Logger -> TmpFs -> DynFlags -> UnitEnv -> CppOpts -> FilePath -> FilePath -> IO ()
- data CppOpts = CppOpts {
  - sourceCodePreprocessor :: !SourceCodePreprocessor
  - cppLinePragmas :: !Bool
  }
- getGhcVersionPathName :: DynFlags -> UnitEnv -> IO (Maybe FilePath)
- getGhcVersionIncludeFlags :: DynFlags -> UnitEnv -> IO [String]
- applyCDefs :: DefunctionalizedCDefs -> Logger -> DynFlags -> IO [String]
- offsetIncludePaths :: DynFlags -> IncludeSpecs -> IncludeSpecs

# Documentation

doCpp :: Logger -> TmpFs -> DynFlags -> UnitEnv -> CppOpts -> FilePath -> FilePath -> IO () Source #

Run either the Haskell preprocessor, JavaScript preprocessor or the C preprocessor, as per the `CppOpts` passed. See Note [Preprocessing invocations].

UnitEnv is needed to compute MIN_VERSION macros

If you change the macros defined by this function make sure to update the user guide.

data CppOpts Source #

Constructors

CppOpts |
Fields sourceCodePreprocessor :: !SourceCodePreprocessor cppLinePragmas :: !Bool Enable generation of LINE pragmas

getGhcVersionPathName :: DynFlags -> UnitEnv -> IO (Maybe FilePath) Source #

Find out path to `ghcversion.h` file

getGhcVersionIncludeFlags :: DynFlags -> UnitEnv -> IO [String] Source #

applyCDefs :: DefunctionalizedCDefs -> Logger -> DynFlags -> IO [String] Source #

offsetIncludePaths :: DynFlags -> IncludeSpecs -> IncludeSpecs Source #