-lintCoreBindings :: DynFlags -> String -> [CoreBind] -> IO ()
-
-lintCoreBindings dflags _whoDunnit _binds
- | not (dopt Opt_DoCoreLinting dflags)
- = return ()
-
-lintCoreBindings dflags whoDunnit binds
- | isEmptyBag errs
- = do { showPass dflags ("Core Linted result of " ++ whoDunnit)
- ; unless (isEmptyBag warns || opt_NoDebugOutput) $ printDump $
- (banner "warnings" $$ displayMessageBag warns)
- ; return () }
-
- | otherwise
- = do { printDump (vcat [ banner "errors", displayMessageBag errs
- , ptext (sLit "*** Offending Program ***")
- , pprCoreBindings binds
- , ptext (sLit "*** End of Offense ***") ])
-
- ; ghcExit dflags 1 }
+lintCoreBindings :: [CoreBind] -> (Bag Message, Bag Message)
+-- Returns (warnings, errors)
+lintCoreBindings binds
+ = initL (lint_binds binds)