-dumpIfSet :: DynFlags -> (DynFlags -> Bool) -> String -> SDoc -> IO ()
-dumpIfSet dflags flag hdr doc
- | not (flag dflags) = return ()
- | otherwise = printDump dump
- where
- dump = vcat [text "",
- line <+> text hdr <+> line,
- doc,
- text ""]
- line = text (take 20 (repeat '='))
+showPass :: DynFlags -> String -> IO ()
+showPass dflags what
+ | verbosity dflags >= 2 = hPutStr stderr ("*** "++what++":\n")
+ | otherwise = return ()
+
+dumpIfSet :: Bool -> String -> SDoc -> IO ()
+dumpIfSet flag hdr doc
+ | not flag = return ()
+ | otherwise = printDump (dump hdr doc)
+
+dumpIfSet_core :: DynFlags -> DynFlag -> String -> SDoc -> IO ()
+dumpIfSet_core dflags flag hdr doc
+ | dopt flag dflags
+ || verbosity dflags >= 4
+ || dopt Opt_D_verbose_core2core dflags = printDump (dump hdr doc)
+ | otherwise = return ()
+
+dumpIfSet_dyn :: DynFlags -> DynFlag -> String -> SDoc -> IO ()
+dumpIfSet_dyn dflags flag hdr doc
+ | dopt flag dflags || verbosity dflags >= 4 = printDump (dump hdr doc)
+ | otherwise = return ()
+
+dump hdr doc
+ = vcat [text "",
+ line <+> text hdr <+> line,
+ doc,
+ text ""]
+ where
+ line = text (take 20 (repeat '='))