X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fiface%2FMkIface.lhs;h=cafb6b6692d2e50b60d7a48a895688b717f27070;hb=274a7b1ab7cf30fd1ceaddd02f991eaf694cc37c;hp=2f15ee377365e7a24529ddfaecf96fdba176929b;hpb=9d7da331989abcd1844e9d03b8d1e4163796fa85;p=ghc-hetmet.git diff --git a/ghc/compiler/iface/MkIface.lhs b/ghc/compiler/iface/MkIface.lhs index 2f15ee3..cafb6b6 100644 --- a/ghc/compiler/iface/MkIface.lhs +++ b/ghc/compiler/iface/MkIface.lhs @@ -234,7 +234,7 @@ import DATA_IOREF ( writeIORef ) import Monad ( when ) import List ( insert ) import Maybes ( orElse, mapCatMaybes, isNothing, isJust, - fromJust, expectJust, MaybeErr(..) ) + expectJust, MaybeErr(..) ) \end{code} @@ -321,7 +321,7 @@ mkIface hsc_env maybe_old_iface -- Debug printing ; when (isJust pp_orphs && dopt Opt_WarnOrphans dflags) - (printDump (fromJust pp_orphs)) + (printDump (expectJust "mkIface" pp_orphs)) ; when (dopt Opt_D_dump_hi_diffs dflags) (printDump pp_diffs) ; dumpIfSet_dyn dflags Opt_D_dump_hi "FINAL INTERFACE" (pprModIface new_iface) @@ -336,18 +336,11 @@ mkIface hsc_env maybe_old_iface ----------------------------- -writeIfaceFile :: HscEnv -> ModLocation -> ModIface -> Bool -> IO () --- Write the interface file, if necessary -writeIfaceFile hsc_env location new_iface no_change_at_all - | no_change_at_all = return () - | ghc_mode == Interactive = return () - | ghc_mode == JustTypecheck = return () - | otherwise - = do { createDirectoryHierarchy (directoryOf hi_file_path) - ; writeBinIface hi_file_path new_iface } - where - ghc_mode = ghcMode (hsc_dflags hsc_env) - hi_file_path = ml_hi_file location +writeIfaceFile :: ModLocation -> ModIface -> IO () +writeIfaceFile location new_iface + = do createDirectoryHierarchy (directoryOf hi_file_path) + writeBinIface hi_file_path new_iface + where hi_file_path = ml_hi_file location ----------------------------- @@ -782,8 +775,8 @@ check_old_iface mod_summary source_unchanged maybe_iface -- If the source has changed and we're in interactive mode, avoid reading -- an interface; just return the one we might have been supplied with. - getGhciMode `thenM` \ ghci_mode -> - if (ghci_mode == Interactive || ghci_mode == JustTypecheck) + getGhcMode `thenM` \ ghc_mode -> + if (ghc_mode == Interactive || ghc_mode == JustTypecheck) && not source_unchanged then returnM (outOfDate, maybe_iface) else @@ -896,7 +889,7 @@ checkModUsage (Usage { usg_name = mod_name, usg_mod = old_mod_vers, -- CHECK EXPORT LIST if checkExportList maybe_old_export_vers new_export_vers then out_of_date_vers (ptext SLIT(" Export list changed")) - (fromJust maybe_old_export_vers) + (expectJust "checkModUsage" maybe_old_export_vers) new_export_vers else