projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-02-11 08:20:38 by chak]
[ghc-hetmet.git]
/
ghc
/
compiler
/
main
/
ErrUtils.lhs
diff --git
a/ghc/compiler/main/ErrUtils.lhs
b/ghc/compiler/main/ErrUtils.lhs
index
a262bd6
..
c8beedd
100644
(file)
--- a/
ghc/compiler/main/ErrUtils.lhs
+++ b/
ghc/compiler/main/ErrUtils.lhs
@@
-12,6
+12,7
@@
module ErrUtils (
printErrorsAndWarnings, pprBagOfErrors, pprBagOfWarnings,
printErrorsAndWarnings, pprBagOfErrors, pprBagOfWarnings,
+ printError,
ghcExit,
doIfSet, doIfSet_dyn,
dumpIfSet, dumpIfSet_core, dumpIfSet_dyn, dumpIfSet_dyn_or,
ghcExit,
doIfSet, doIfSet_dyn,
dumpIfSet, dumpIfSet_core, dumpIfSet_dyn, dumpIfSet_dyn_or,
@@
-26,8
+27,9
@@
import Util ( sortLt )
import Outputable
import CmdLineOpts ( DynFlags(..), DynFlag(..), dopt )
import Outputable
import CmdLineOpts ( DynFlags(..), DynFlag(..), dopt )
+import List ( replicate )
import System ( ExitCode(..), exitWith )
import System ( ExitCode(..), exitWith )
-import IO ( hPutStr, stderr )
+import IO ( hPutStr, hPutStrLn, stderr, stdout )
\end{code}
\begin{code}
\end{code}
\begin{code}
@@
-69,6
+71,10
@@
dontAddErrLoc msg = (noSrcLoc, msg)
\end{code}
\end{code}
+\begin{code}
+printError :: String -> IO ()
+printError str = hPutStrLn stderr str
+\end{code}
\begin{code}
type Messages = (Bag WarnMsg, Bag ErrMsg)
\begin{code}
type Messages = (Bag WarnMsg, Bag ErrMsg)
@@
-140,8
+146,12
@@
dumpIfSet_core dflags flag hdr doc
dumpIfSet_dyn :: DynFlags -> DynFlag -> String -> SDoc -> IO ()
dumpIfSet_dyn dflags flag hdr doc
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 ()
+ | dopt flag dflags || verbosity dflags >= 4
+ = if flag `elem` [Opt_D_dump_stix, Opt_D_dump_asm]
+ then printForC stdout (dump hdr doc)
+ else printDump (dump hdr doc)
+ | otherwise
+ = return ()
dumpIfSet_dyn_or :: DynFlags -> [DynFlag] -> String -> SDoc -> IO ()
dumpIfSet_dyn_or dflags flags hdr doc
dumpIfSet_dyn_or :: DynFlags -> [DynFlag] -> String -> SDoc -> IO ()
dumpIfSet_dyn_or dflags flags hdr doc
@@
-156,5
+166,5
@@
dump hdr doc
doc,
text ""]
where
doc,
text ""]
where
- line = text (take 20 (repeat '='))
+ line = text (replicate 20 '=')
\end{code}
\end{code}