GHC.Driver.IncludeSpecs

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

Safe Haskell | Ignore
Language | GHC2021

GHC.Driver.IncludeSpecs

Synopsis

- data IncludeSpecs = IncludeSpecs {
  - includePathsQuote :: [String]
  - includePathsGlobal :: [String]
  - includePathsQuoteImplicit :: [String]
  }
- addGlobalInclude :: IncludeSpecs -> [String] -> IncludeSpecs
- addQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
- addImplicitQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
- flattenIncludes :: IncludeSpecs -> [String]

# Documentation

data IncludeSpecs #

Used to differentiate the scope an include needs to apply to. We have to split the include paths to avoid accidentally forcing recursive includes since -I overrides the system search paths. See #14312.

Constructors

IncludeSpecs |
Fields includePathsQuote :: [String] includePathsGlobal :: [String] includePathsQuoteImplicit :: [String] See Note [Implicit include paths]

#### Instances

Instances details

Show IncludeSpecs # |
Instance details Defined in GHC.Driver.IncludeSpecs Methods showsPrec :: Int -> IncludeSpecs -> ShowS # show :: IncludeSpecs -> String # showList :: [IncludeSpecs] -> ShowS #

addGlobalInclude :: IncludeSpecs -> [String] -> IncludeSpecs #

Append to the list of includes a path that shall be included using `-I` when the C compiler is called. These paths override system search paths.

addQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs #

Append to the list of includes a path that shall be included using `-iquote` when the C compiler is called. These paths only apply when quoted includes are used. e.g. #include "foo.h"

addImplicitQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs #

These includes are not considered while fingerprinting the flags for iface | See Note [Implicit include paths]

flattenIncludes :: IncludeSpecs -> [String] #

Concatenate and flatten the list of global and quoted includes returning just a flat list of paths.