| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Development.IDE.GHC.Compat
Description
Attempt at hiding the GHC version differences we can.
Synopsis
- hPutStringBuffer :: Handle -> StringBuffer -> IO ()
- addIncludePathsQuote :: FilePath -> DynFlags -> DynFlags
- getModuleHash :: ModIface -> Fingerprint
- setUpTypedHoles :: DynFlags -> DynFlags
- lookupNameCache :: NameCache -> Module -> OccName -> IO Name
- disableWarningsAsErrors :: DynFlags -> DynFlags
- reLoc :: LocatedAn a e -> Located e
- reLocA :: Located e -> LocatedAn ann e
- renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg)
- pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope GhcMessage)) -> ParseResult a
- myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Bool -> Module -> ModLocation -> CoreExpr -> IO (Id, [CgStgTopBinding], InfoTableProvMap, CollectedCCs)
- data Usage
- = UsagePackageModule { }
- | UsageHomeModule { }
- | UsageFile { }
- | UsageHomeModuleInterface { }
- | UsageMergedRequirement { }
- data FastStringCompat
- bytesFS :: FastString -> ByteString
- mkFastStringByteString :: ByteString -> FastString
- nodeInfo' :: HieAST TypeIndex -> NodeInfo TypeIndex
- getNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a)
- getSourceNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a)
- sourceNodeInfo :: HieAST a -> Maybe (NodeInfo a)
- generatedNodeInfo :: HieAST a -> Maybe (NodeInfo a)
- simpleNodeInfoCompat :: FastStringCompat -> FastStringCompat -> NodeInfo a
- isAnnotationInNodeInfo :: (FastStringCompat, FastStringCompat) -> NodeInfo a -> Bool
- nodeAnnotations :: NodeInfo a -> Set (FastStringCompat, FastStringCompat)
- mkAstNode :: NodeInfo a -> Span -> [HieAST a] -> HieAST a
- combineRealSrcSpans :: RealSrcSpan -> RealSrcSpan -> RealSrcSpan
- isQualifiedImport :: ImportDecl a -> Bool
- data GhcVersion
- ghcVersion :: GhcVersion
- ghcVersionStr :: String
- data HieFileResult = HieFileResult {}
- data HieFile = HieFile {}
- hieExportNames :: HieFile -> [(SrcSpan, Name)]
- mkHieFile' :: ModSummary -> [AvailInfo] -> HieASTs Type -> ByteString -> Hsc HieFile
- enrichHie :: TypecheckedSource -> RenamedSource -> Bag EvBind -> [ClsInst] -> [TyCon] -> HieASTs Type
- writeHieFile :: FilePath -> HieFile -> IO ()
- readHieFile :: NameCache -> FilePath -> IO HieFileResult
- setHieDir :: FilePath -> DynFlags -> DynFlags
- dontWriteHieFiles :: DynFlags -> DynFlags
- module Development.IDE.GHC.Compat.Core
- module Development.IDE.GHC.Compat.Env
- module Development.IDE.GHC.Compat.Iface
- module Development.IDE.GHC.Compat.Logger
- module Development.IDE.GHC.Compat.Outputable
- module Development.IDE.GHC.Compat.Parser
- module Development.IDE.GHC.Compat.Plugins
- module Development.IDE.GHC.Compat.Units
- data Option
- runUnlit :: Logger -> DynFlags -> [Option] -> IO ()
- runPp :: Logger -> DynFlags -> [Option] -> IO ()
- hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO (ForeignHValue, [Linkable], PkgsLoaded))
- type CoreExpr = Expr CoreBndr
- simplifyExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- tidyExpr :: TidyEnv -> CoreExpr -> CoreExpr
- emptyTidyEnv :: TidyEnv
- tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)
- corePrepExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- corePrepPgm :: Logger -> CorePrepConfig -> CorePrepPgmConfig -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO CoreProgram
- lintInteractiveExpr :: SDoc -> HscEnv -> CoreExpr -> IO ()
- icInteractiveModule :: InteractiveContext -> Module
- type HomePackageTable = DModuleNameEnv HomeModInfo
- lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo
- loadModulesHome :: [HomeModInfo] -> HscEnv -> HscEnv
- hugElts :: HomeUnitGraph -> [(UnitId, HomeUnitEnv)]
- bcoFreeNames :: UnlinkedBCO -> UniqDSet Name
- type ModIfaceAnnotation = Annotation
- pattern Annotation :: CoreAnnTarget -> AnnPayload -> Annotation
- data AnnTarget name = ModuleTarget Module
- extendAnnEnvList :: AnnEnv -> [Annotation] -> AnnEnv
- module GHC.Types.Unique.DSet
- module GHC.Types.Unique.Set
- module GHC.Types.Unique.DFM
- getDependentMods :: ModIface -> [ModuleName]
- flattenBinds :: [Bind b] -> [(b, Expr b)]
- mkRnEnv2 :: InScopeSet -> RnEnv2
- emptyInScopeSet :: InScopeSet
- data Unfolding
- = NoUnfolding
- | BootUnfolding
- | OtherCon [AltCon]
- | DFunUnfolding { }
- | CoreUnfolding { }
- noUnfolding :: Unfolding
- loadExpr :: Interp -> HscEnv -> SrcSpan -> UnlinkedBCO -> IO ForeignHValue
- byteCodeGen :: HscEnv -> Module -> [CgStgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode
- bc_bcos :: CompiledByteCode -> [UnlinkedBCO]
- loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO ([(Name, ForeignHValue)], [Linkable], PkgsLoaded)
- hscInterp :: HscEnv -> Interp
- expectJust :: HasDebugCallStack => String -> Maybe a -> a
- extract_cons :: DataDefnCons a -> [a]
- recDotDot :: forall (p :: Pass) arg. HsRecFields (GhcPass p) arg -> Maybe Int
- data Dependencies
- type NameCacheUpdater = NameCache
- data XModulePs = XModulePs {}
- tcInitTidyEnv :: ZonkM TidyEnv
Documentation
hPutStringBuffer :: Handle -> StringBuffer -> IO () #
getModuleHash :: ModIface -> Fingerprint Source #
setUpTypedHoles :: DynFlags -> DynFlags Source #
renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg) Source #
pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope GhcMessage)) -> ParseResult a Source #
myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Bool -> Module -> ModLocation -> CoreExpr -> IO (Id, [CgStgTopBinding], InfoTableProvMap, CollectedCCs) Source #
Records modules for which changes may force recompilation of this module See wiki: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/recompilation-avoidance
This differs from Dependencies. A module X may be in the dep_mods of this module (via an import chain) but if we don't use anything from X it won't appear in our Usage
Constructors
| UsagePackageModule | Module from another package |
Fields
| |
| UsageHomeModule | Module from the current package |
Fields
| |
| UsageFile | A file upon which the module depends, e.g. a CPP #include, or using TH's
|
Fields
| |
| UsageHomeModuleInterface | |
Fields
| |
| UsageMergedRequirement | A requirement which was merged into this one. |
Fields
| |
data FastStringCompat Source #
Instances
| IsString FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat Methods fromString :: String -> FastStringCompat # | |
| Show FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat Methods showsPrec :: Int -> FastStringCompat -> ShowS # show :: FastStringCompat -> String # showList :: [FastStringCompat] -> ShowS # | |
| Eq FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat Methods (==) :: FastStringCompat -> FastStringCompat -> Bool # (/=) :: FastStringCompat -> FastStringCompat -> Bool # | |
| Ord FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat Methods compare :: FastStringCompat -> FastStringCompat -> Ordering # (<) :: FastStringCompat -> FastStringCompat -> Bool # (<=) :: FastStringCompat -> FastStringCompat -> Bool # (>) :: FastStringCompat -> FastStringCompat -> Bool # (>=) :: FastStringCompat -> FastStringCompat -> Bool # max :: FastStringCompat -> FastStringCompat -> FastStringCompat # min :: FastStringCompat -> FastStringCompat -> FastStringCompat # | |
bytesFS :: FastString -> ByteString #
Gives the Modified UTF-8 encoded bytes corresponding to a FastString
mkFastStringByteString :: ByteString -> FastString #
Create a FastString by copying an existing ByteString
getNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a) Source #
getSourceNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a) Source #
Like getNodeIds but with generated node removed
isAnnotationInNodeInfo :: (FastStringCompat, FastStringCompat) -> NodeInfo a -> Bool Source #
nodeAnnotations :: NodeInfo a -> Set (FastStringCompat, FastStringCompat) Source #
combineRealSrcSpans :: RealSrcSpan -> RealSrcSpan -> RealSrcSpan #
Combines two SrcSpan into one that spans at least all the characters
within both spans. Assumes the "file" part is the same in both inputs
isQualifiedImport :: ImportDecl a -> Bool Source #
data GhcVersion Source #
Instances
HIE Compat
data HieFileResult #
Constructors
| HieFileResult | |
GHC builds up a wealth of information about Haskell source as it compiles it.
.hie files are a way of persisting some of this information to disk so that
external tools that need to work with haskell source don't need to parse,
typecheck, and rename all over again. These files contain:
a simplified AST
- nodes are annotated with source positions and types
- identifiers are annotated with scope information
- the raw bytes of the initial Haskell source
Besides saving compilation cycles, .hie files also offer a more stable
interface than the GHC API.
Constructors
| HieFile | |
Fields
| |
mkHieFile' :: ModSummary -> [AvailInfo] -> HieASTs Type -> ByteString -> Hsc HieFile Source #
enrichHie :: TypecheckedSource -> RenamedSource -> Bag EvBind -> [ClsInst] -> [TyCon] -> HieASTs Type #
writeHieFile :: FilePath -> HieFile -> IO () #
Write a HieFile to the given FilePath, with a proper header and
symbol tables for Names and FastStrings
readHieFile :: NameCache -> FilePath -> IO HieFileResult #
dontWriteHieFiles :: DynFlags -> DynFlags Source #
Compat modules
Extras that rely on compat modules
SysTools
When invoking external tools as part of the compilation pipeline, we pass these a sequence of options on the command-line. Rather than just using a list of Strings, we use a type that allows us to distinguish between filepaths and 'other stuff'. The reason for this is that this type gives us a handle on transforming filenames, and filenames only, to whatever format they're expected to be on a particular platform.
Constructors
| FileOption String String | |
| Option String |
Recompilation avoidance
hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO (ForeignHValue, [Linkable], PkgsLoaded)) #
emptyTidyEnv :: TidyEnv #
corePrepPgm :: Logger -> CorePrepConfig -> CorePrepPgmConfig -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO CoreProgram #
type HomePackageTable = DModuleNameEnv HomeModInfo #
Helps us find information about modules in the home package
lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo #
loadModulesHome :: [HomeModInfo] -> HscEnv -> HscEnv Source #
Load modules, quickly. Input doesn't need to be desugared. A module must be loaded before dependent modules can be typechecked. This variant of loadModuleHome will *never* cause recompilation, it just modifies the session. The order modules are loaded is important when there are hs-boot files. In particular you should make sure to load the .hs version of a file after the .hs-boot version.
hugElts :: HomeUnitGraph -> [(UnitId, HomeUnitEnv)] #
bcoFreeNames :: UnlinkedBCO -> UniqDSet Name #
Finds external references. Remember to remove the names defined by this group of BCOs themselves
type ModIfaceAnnotation = Annotation Source #
pattern Annotation :: CoreAnnTarget -> AnnPayload -> Annotation #
An annotation target
Constructors
| ModuleTarget Module | We are annotating a particular module |
Instances
| Functor AnnTarget | |
| Binary name => Binary (AnnTarget name) | |
| Outputable name => Outputable (AnnTarget name) | |
Defined in GHC.Types.Annotations | |
extendAnnEnvList :: AnnEnv -> [Annotation] -> AnnEnv #
Add the given annotation to the environment.
module GHC.Types.Unique.DSet
module GHC.Types.Unique.Set
module GHC.Types.Unique.DFM
getDependentMods :: ModIface -> [ModuleName] Source #
flattenBinds :: [Bind b] -> [(b, Expr b)] #
Collapse all the bindings in the supplied groups into a single
list of lhs/rhs pairs suitable for binding in a Rec binding group
mkRnEnv2 :: InScopeSet -> RnEnv2 #
Records the unfolding of an identifier, which is approximately the form the identifier would have if we substituted its definition in for the identifier. This type should be treated as abstract everywhere except in GHC.Core.Unfold
Constructors
| NoUnfolding | We have no information about the unfolding. |
| BootUnfolding | We have no information about the unfolding, because
this |
| OtherCon [AltCon] | It ain't one of these constructors.
data C = C !(Int -> Int)
case x of { C f -> ... }Here, |
| DFunUnfolding | |
| CoreUnfolding | An unfolding with redundant cached information. Parameters: uf_tmpl: Template used to perform unfolding; NB: Occurrence info is guaranteed correct: see Note [OccInfo in unfoldings and rules] uf_is_top: Is this a top level binding? uf_is_value: uf_is_work_free: Does this waste only a little work if we expand it inside an inlining?
Basically this is a cached version of uf_guidance: Tells us about the size of the unfolding template |
Fields | |
There is no known Unfolding
loadExpr :: Interp -> HscEnv -> SrcSpan -> UnlinkedBCO -> IO ForeignHValue #
Load a single expression, including first loading packages and modules that this expression depends on.
Raises an IO exception (ProgramError) if it can't find a compiled
version of the dependents to load.
byteCodeGen :: HscEnv -> Module -> [CgStgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode #
bc_bcos :: CompiledByteCode -> [UnlinkedBCO] #
loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO ([(Name, ForeignHValue)], [Linkable], PkgsLoaded) #
hscInterp :: HscEnv -> Interp #
Retrieve the target code interpreter
Fails if no target code interpreter is available
expectJust :: HasDebugCallStack => String -> Maybe a -> a #
extract_cons :: DataDefnCons a -> [a] Source #
data Dependencies #
Dependency information about ALL modules and packages below this one
in the import hierarchy. This is the serialisable version of ImportAvails.
Invariant: the dependencies of a module M never includes M.
Invariant: none of the lists contain duplicates.
Invariant: lists are ordered canonically (e.g. using stableModuleCmp)
See Note [Transitive Information in Dependencies]
Instances
| Binary Dependencies | |
Defined in GHC.Unit.Module.Deps Methods put_ :: BinHandle -> Dependencies -> IO () # put :: BinHandle -> Dependencies -> IO (Bin Dependencies) # get :: BinHandle -> IO Dependencies # | |
| Eq Dependencies | |
Defined in GHC.Unit.Module.Deps | |
type NameCacheUpdater = NameCache Source #
Haskell Module extension point: GHC specific
Constructors
| XModulePs | |
Fields
| |
Instances
| Data XModulePs | |
Defined in GHC.Hs Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> XModulePs -> c XModulePs # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c XModulePs # toConstr :: XModulePs -> Constr # dataTypeOf :: XModulePs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c XModulePs) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c XModulePs) # gmapT :: (forall b. Data b => b -> b) -> XModulePs -> XModulePs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> XModulePs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> XModulePs -> r # gmapQ :: (forall d. Data d => d -> u) -> XModulePs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> XModulePs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # | |