Commit 05120ecd authored by Edward Z. Yang's avatar Edward Z. Yang

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

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent b80d5739
......@@ -229,8 +229,7 @@ compileOne' m_tc_result mHscMessage
hm_linkable = Just linkable })
HscNothing ->
do (iface, changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash
when (gopt Opt_WriteInterface dflags) $
hscWriteIface dflags iface changed summary
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,9 +624,8 @@ hscCompileOneShot' hsc_env mod_summary src_changed
dflags <- getDynFlags
case hscTarget dflags of
HscNothing -> do
when (gopt Opt_WriteInterface dflags) $ liftIO $ do
(iface, changed, _details) <- hscSimpleIface hsc_env tc_result mb_old_hash
hscWriteIface dflags iface changed mod_summary
(iface, changed, _) <- hscSimpleIface' tc_result mb_old_hash
liftIO $ hscWriteIface dflags iface changed mod_summary
return HscNotGeneratingCode
_ ->
case ms_hsc_src mod_summary of
......@@ -1107,7 +1106,9 @@ hscNormalIface' simpl_result mb_old_iface = do
--------------------------------------------------------------
hscWriteIface :: DynFlags -> ModIface -> Bool -> ModSummary -> IO ()
hscWriteIface dflags iface no_change mod_summary = do
hscWriteIface dflags iface no_change mod_summary
| not (gopt Opt_WriteInterface dflags) = return ()
| otherwise = do
let ifaceFile = ml_hi_file (ms_location mod_summary)
unless no_change $
{-# SCC "writeIface" #-}
......
......@@ -578,3 +578,9 @@ 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,3 +406,4 @@ 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