[commit: ghc] master: Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code." (5031772)

git at git.haskell.org git at git.haskell.org
Fri Jun 27 13:06:58 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5031772861a64dd2d4f6dc047add31b3231b2a52/ghc

>---------------------------------------------------------------

commit 5031772861a64dd2d4f6dc047add31b3231b2a52
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Fri Jun 27 14:06:51 2014 +0100

    Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code."
    
    This reverts commit 05120ecd95b2ebf9b096a95304793cd78be9506e.


>---------------------------------------------------------------

5031772861a64dd2d4f6dc047add31b3231b2a52
 compiler/main/DriverPipeline.hs | 3 ++-
 compiler/main/HscMain.hs        | 9 ++++-----
 testsuite/tests/driver/Makefile | 6 ------
 testsuite/tests/driver/all.T    | 1 -
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index b7cb412..11427e2 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -229,7 +229,8 @@ compileOne' m_tc_result mHscMessage
                                                 hm_linkable = Just linkable })
                HscNothing ->
                    do (iface, changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash
-                      hscWriteIface dflags iface changed summary
+                      when (gopt Opt_WriteInterface dflags) $
+                         hscWriteIface dflags iface changed summary
                       let linkable = if isHsBoot src_flavour
                                      then maybe_old_linkable
                                      else Just (LM (ms_hs_date summary) this_mod [])
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 5d60559..aef6007 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -624,8 +624,9 @@ hscCompileOneShot' hsc_env mod_summary src_changed
             dflags <- getDynFlags
             case hscTarget dflags of
                 HscNothing -> do
-                    (iface, changed, _) <- hscSimpleIface' tc_result mb_old_hash
-                    liftIO $ hscWriteIface dflags iface changed mod_summary
+                    when (gopt Opt_WriteInterface dflags) $ liftIO $ do
+                        (iface, changed, _details) <- hscSimpleIface hsc_env tc_result mb_old_hash
+                        hscWriteIface dflags iface changed mod_summary
                     return HscNotGeneratingCode
                 _ ->
                     case ms_hsc_src mod_summary of
@@ -1106,9 +1107,7 @@ hscNormalIface' simpl_result mb_old_iface = do
 --------------------------------------------------------------
 
 hscWriteIface :: DynFlags -> ModIface -> Bool -> ModSummary -> IO ()
-hscWriteIface dflags iface no_change mod_summary
-  | not (gopt Opt_WriteInterface dflags) = return ()
-  | otherwise = do
+hscWriteIface dflags iface no_change mod_summary = do
     let ifaceFile = ml_hi_file (ms_location mod_summary)
     unless no_change $
         {-# SCC "writeIface" #-}
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile
index 06821d8..62aa2f9 100644
--- a/testsuite/tests/driver/Makefile
+++ b/testsuite/tests/driver/Makefile
@@ -578,9 +578,3 @@ write_interface_make:
 	$(RM) -rf write_interface_make/A011.hi
 	"$(TEST_HC)" $(TEST_HC_OPTS) -hidir write_interface_make -fno-code -fwrite-interface --make A011.hs
 	test -f write_interface_make/A011.hi
-
-.PHONY: no_write_interface
-no_write_interface:
-	$(RM) -rf no_write_interface/A011.hi
-	"$(TEST_HC)" $(TEST_HC_OPTS) -hidir no_write_interface -fno-write-interface -c A011.hs
-	! test -f no_write_interface/A011.hi
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 52b6e93..7236ec1 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -406,4 +406,3 @@ test('T9050', normal, build_T9050, [])
 
 test('write_interface_oneshot', normal, run_command, ['$MAKE -s --no-print-directory write_interface_oneshot'])
 test('write_interface_make', normal, run_command, ['$MAKE -s --no-print-directory write_interface_make'])
-test('no_write_interface', normal, run_command, ['$MAKE -s --no-print-directory no_write_interface'])



More information about the ghc-commits mailing list