GHC.Core.Lint

ghc-9.2.6: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Core.Lint

Contents

- Debug output

Synopsis

- lintCoreBindings :: DynFlags -> CoreToDo -> [Var] -> CoreProgram -> WarnsAndErrs
- lintUnfolding :: Bool -> DynFlags -> SrcLoc -> VarSet -> CoreExpr -> Maybe (Bag SDoc)
- lintPassResult :: HscEnv -> CoreToDo -> CoreProgram -> IO ()
- lintInteractiveExpr :: SDoc -> HscEnv -> CoreExpr -> IO ()
- lintExpr :: DynFlags -> [Var] -> CoreExpr -> Maybe (Bag SDoc)
- lintAnnots :: SDoc -> (ModGuts -> CoreM ModGuts) -> ModGuts -> CoreM ModGuts
- lintAxioms :: Logger -> DynFlags -> SDoc -> [CoAxiom Branched] -> IO ()
- interactiveInScope :: InteractiveContext -> [Var]
- endPass :: CoreToDo -> CoreProgram -> [CoreRule] -> CoreM ()
- endPassIO :: HscEnv -> PrintUnqualified -> CoreToDo -> CoreProgram -> [CoreRule] -> IO ()
- displayLintResults :: Logger -> DynFlags -> Bool -> SDoc -> SDoc -> WarnsAndErrs -> IO ()
- dumpPassResult :: Logger -> DynFlags -> PrintUnqualified -> Maybe DumpFlag -> SDoc -> SDoc -> CoreProgram -> [CoreRule] -> IO ()
- dumpIfSet :: Logger -> DynFlags -> Bool -> CoreToDo -> SDoc -> SDoc -> IO ()

# Documentation

lintCoreBindings :: DynFlags -> CoreToDo -> [Var] -> CoreProgram -> WarnsAndErrs Source #

Type-check a `CoreProgram`. See Note [Core Lint guarantee].

lintUnfolding :: Bool -> DynFlags -> SrcLoc -> VarSet -> CoreExpr -> Maybe (Bag SDoc) Source #

lintPassResult :: HscEnv -> CoreToDo -> CoreProgram -> IO () Source #

lintInteractiveExpr Source #

Arguments

:: SDoc | The source of the linted expression
-> HscEnv |
-> CoreExpr |
-> IO () |

lintExpr :: DynFlags -> [Var] -> CoreExpr -> Maybe (Bag SDoc) Source #

lintAnnots :: SDoc -> (ModGuts -> CoreM ModGuts) -> ModGuts -> CoreM ModGuts Source #

This checks whether a pass correctly looks through debug annotations (`SourceNote`). This works a bit different from other consistency checks: We check this by running the given task twice, noting all differences between the results.

lintAxioms Source #

Arguments

:: Logger |
-> DynFlags |
-> SDoc | The source of the linted axioms
-> [CoAxiom Branched] |
-> IO () |

interactiveInScope :: InteractiveContext -> [Var] Source #

## Debug output

endPass :: CoreToDo -> CoreProgram -> [CoreRule] -> CoreM () Source #

endPassIO :: HscEnv -> PrintUnqualified -> CoreToDo -> CoreProgram -> [CoreRule] -> IO () Source #

displayLintResults Source #

Arguments

:: Logger |
-> DynFlags |
-> Bool | If `True`, display linter warnings. If `False`, ignore linter warnings.
-> SDoc | The source of the linted program
-> SDoc | The linted program, pretty-printed
-> WarnsAndErrs |
-> IO () |

dumpPassResult :: Logger -> DynFlags -> PrintUnqualified -> Maybe DumpFlag -> SDoc -> SDoc -> CoreProgram -> [CoreRule] -> IO () Source #

dumpIfSet :: Logger -> DynFlags -> Bool -> CoreToDo -> SDoc -> SDoc -> IO () Source #