Commit 50317728 authored by Edward Z. Yang's avatar Edward Z. Yang

Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code."

This reverts commit 05120ecd.
parent 05120ecd
......@@ -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 [])
......
......@@ -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" #-}
......
......@@ -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
......@@ -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'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment