Skip to content
Snippets Groups Projects
Commit ac91dafa authored by sof's avatar sof
Browse files

[project @ 1998-02-09 12:58:10 by sof]

New debug flag: -dshow-rn-imports, dump to stderr the paths to the interface files that are slurped.
parent 8d2eb272
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ module CmdLineOpts ( ...@@ -37,6 +37,7 @@ module CmdLineOpts (
opt_D_dump_tc, opt_D_dump_tc,
opt_D_show_passes, opt_D_show_passes,
opt_D_show_rn_trace, opt_D_show_rn_trace,
opt_D_show_rn_imports,
opt_D_simplifier_stats, opt_D_simplifier_stats,
opt_D_source_stats, opt_D_source_stats,
opt_D_verbose_core2core, opt_D_verbose_core2core,
...@@ -290,6 +291,7 @@ opt_D_dump_stranal = lookUp SLIT("-ddump-stranal") ...@@ -290,6 +291,7 @@ opt_D_dump_stranal = lookUp SLIT("-ddump-stranal")
opt_D_dump_tc = lookUp SLIT("-ddump-tc") opt_D_dump_tc = lookUp SLIT("-ddump-tc")
opt_D_show_passes = lookUp SLIT("-dshow-passes") opt_D_show_passes = lookUp SLIT("-dshow-passes")
opt_D_show_rn_trace = lookUp SLIT("-dshow-rn-trace") opt_D_show_rn_trace = lookUp SLIT("-dshow-rn-trace")
opt_D_show_rn_imports = lookUp SLIT("-dshow-rn-imports")
opt_D_simplifier_stats = lookUp SLIT("-dsimplifier-stats") opt_D_simplifier_stats = lookUp SLIT("-dsimplifier-stats")
opt_D_source_stats = lookUp SLIT("-dsource-stats") opt_D_source_stats = lookUp SLIT("-dsource-stats")
opt_D_verbose_core2core = lookUp SLIT("-dverbose-simpl") opt_D_verbose_core2core = lookUp SLIT("-dverbose-simpl")
......
...@@ -20,7 +20,7 @@ module RnIfaces ( ...@@ -20,7 +20,7 @@ module RnIfaces (
#include "HsVersions.h" #include "HsVersions.h"
import CmdLineOpts ( opt_PruneTyDecls, opt_PruneInstDecls, import CmdLineOpts ( opt_PruneTyDecls, opt_PruneInstDecls,
opt_IgnoreIfacePragmas opt_D_show_rn_imports, opt_IgnoreIfacePragmas
) )
import HsSyn ( HsDecl(..), TyDecl(..), ClassDecl(..), InstDecl(..), IfaceSig(..), import HsSyn ( HsDecl(..), TyDecl(..), ClassDecl(..), InstDecl(..), IfaceSig(..),
HsType(..), ConDecl(..), IE(..), ConDetails(..), Sig(..), HsType(..), ConDecl(..), IE(..), ConDetails(..), Sig(..),
...@@ -977,22 +977,24 @@ findAndReadIface doc_str mod_name as_source ...@@ -977,22 +977,24 @@ findAndReadIface doc_str mod_name as_source
file_path = dir ++ '/' : moduleString mod_name ++ (mod_suffix hisuf) file_path = dir ++ '/' : moduleString mod_name ++ (mod_suffix hisuf)
\end{code} \end{code}
@readIface@ trys just one file. @readIface@ tries just the one file.
\begin{code} \begin{code}
readIface :: String -> RnMG (Maybe ParsedIface) readIface :: String -> RnMG (Maybe ParsedIface)
-- Nothing <=> file not found, or unreadable, or illegible -- Nothing <=> file not found, or unreadable, or illegible
-- Just x <=> successfully found and parsed -- Just x <=> successfully found and parsed
readIface file_path readIface file_path
= ioToRnMG (hGetStringBuffer file_path) `thenRn` \ read_result -> = ioToRnMG (hGetStringBuffer file_path) `thenRn` \ read_result ->
--traceRn (hcat[ptext SLIT("Opening...."), text file_path]) `thenRn_`
case read_result of case read_result of
Right contents -> Right contents ->
case parseIface contents (mkSrcLoc (mkFastString file_path) 1) of case parseIface contents (mkSrcLoc (mkFastString file_path) 1) of
Failed err -> Failed err -> failWithRn Nothing err
failWithRn Nothing err
Succeeded (PIface iface) -> Succeeded (PIface iface) ->
returnRn (Just iface) if opt_D_show_rn_imports then
putDocRn (hcat[ptext SLIT("Read "), text file_path]) `thenRn_`
returnRn (Just iface)
else
returnRn (Just iface)
Left err -> Left err ->
if isDoesNotExistError err then if isDoesNotExistError err then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment