diff options
Diffstat (limited to 'ghc/compiler/main/CodeOutput.lhs')
-rw-r--r-- | ghc/compiler/main/CodeOutput.lhs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 1e33654169..33357fcbc2 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -35,6 +35,7 @@ import CmdLineOpts ( DynFlags, HscLang(..), dopt_OutName ) import TmpFiles ( newTempName ) import IO ( IOMode(..), hClose, openFile, Handle ) +import IO ( hPutStr, stderr) -- Debugging \end{code} @@ -81,7 +82,8 @@ codeOutput dflags mod_name tycons core_binds stg_binds doOutput :: String -> (Handle -> IO ()) -> IO () doOutput filenm io_action - = (do handle <- openFile filenm WriteMode + = (do hPutStr stderr ("Writing to" ++ filenm) + handle <- openFile filenm WriteMode io_action handle hClose handle) `catch` (\err -> pprPanic "Failed to open or write code output file" |