GHC.SysTools.Cpp

ghc-9.10.0.20240413: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.SysTools.Cpp

Synopsis

- doCpp :: Logger -> TmpFs -> DynFlags -> UnitEnv -> CppOpts -> FilePath -> FilePath -> IO ()
- data CppOpts = CppOpts {
  - useHsCpp :: !Bool
  - cppLinePragmas :: !Bool
  }
- getGhcVersionPathName :: DynFlags -> UnitEnv -> IO FilePath
- 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 or the C preprocessor, as per the `CppOpts` passed. See Note [Preprocessing invocations].

UnitEnv is needed to compute MIN_VERSION macros

data CppOpts Source #

Constructors

CppOpts |
Fields useHsCpp :: !Bool Use the Haskell C preprocessor, otherwise use the C preprocessor. See the Note [Preprocessing invocations] cppLinePragmas :: !Bool Enable generation of LINE pragmas

getGhcVersionPathName :: DynFlags -> UnitEnv -> IO FilePath Source #

Find out path to `ghcversion.h` file

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

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