Commit b475be32 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

desugar code even when -fno-code is used; fixes #8101

We need to desugar the code, or we don't get the warnings from the
desugarer.
parent 8f377ccd
...@@ -92,12 +92,7 @@ deSugar hsc_env ...@@ -92,12 +92,7 @@ deSugar hsc_env
; let export_set = availsToNameSet exports ; let export_set = availsToNameSet exports
; let target = hscTarget dflags ; let target = hscTarget dflags
; let hpcInfo = emptyHpcInfo other_hpc_info ; let hpcInfo = emptyHpcInfo other_hpc_info
; (msgs, mb_res) ; (msgs, mb_res) <- do
<- case target of
HscNothing ->
return (emptyMessages,
Just ([], nilOL, [], [], NoStubs, hpcInfo, emptyModBreaks))
_ -> do
let want_ticks = gopt Opt_Hpc dflags let want_ticks = gopt Opt_Hpc dflags
|| target == HscInterpreted || target == HscInterpreted
......
...@@ -637,6 +637,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed ...@@ -637,6 +637,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed
compile mb_old_hash reason = runHsc hsc_env' $ do compile mb_old_hash reason = runHsc hsc_env' $ do
liftIO $ msg reason liftIO $ msg reason
tc_result <- genericHscFrontend mod_summary tc_result <- genericHscFrontend mod_summary
guts0 <- hscDesugar' (ms_location mod_summary) tc_result
dflags <- getDynFlags dflags <- getDynFlags
case hscTarget dflags of case hscTarget dflags of
HscNothing -> return HscNotGeneratingCode HscNothing -> return HscNotGeneratingCode
...@@ -647,8 +648,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed ...@@ -647,8 +648,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed
liftIO $ hscWriteIface dflags iface changed mod_summary liftIO $ hscWriteIface dflags iface changed mod_summary
return HscUpdateBoot return HscUpdateBoot
_ -> _ ->
do guts0 <- hscDesugar' (ms_location mod_summary) tc_result do guts <- hscSimplify' guts0
guts <- hscSimplify' guts0
(iface, changed, _details, cgguts) <- hscNormalIface' extCore_filename guts mb_old_hash (iface, changed, _details, cgguts) <- hscNormalIface' extCore_filename guts mb_old_hash
liftIO $ hscWriteIface dflags iface changed mod_summary liftIO $ hscWriteIface dflags iface changed mod_summary
return $ HscRecomp cgguts mod_summary return $ HscRecomp cgguts mod_summary
......
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