[commit: ghc] master: desugar code even when -fno-code is used; fixes #8101 (b475be3)

Ian Lynagh igloo at ghc.haskell.org
Sun Jul 28 18:24:54 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b475be321106f79da115ae203a5a27fabfbb80d8

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

commit b475be321106f79da115ae203a5a27fabfbb80d8
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sun Jul 28 17:01:50 2013 +0100

    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.

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

 compiler/deSugar/Desugar.lhs |    7 +------
 compiler/main/HscMain.hs     |    4 ++--
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs
index bb70aaa..b65304a 100644
--- a/compiler/deSugar/Desugar.lhs
+++ b/compiler/deSugar/Desugar.lhs
@@ -92,12 +92,7 @@ deSugar hsc_env
         ; let export_set = availsToNameSet exports
         ; let target = hscTarget dflags
         ; let hpcInfo = emptyHpcInfo other_hpc_info
-        ; (msgs, mb_res)
-              <- case target of
-                   HscNothing ->
-                       return (emptyMessages,
-                               Just ([], nilOL, [], [], NoStubs, hpcInfo, emptyModBreaks))
-                   _        -> do
+        ; (msgs, mb_res) <- do
 
                      let want_ticks = gopt Opt_Hpc dflags
                                    || target == HscInterpreted
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index d94fc78..2c2df87 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -637,6 +637,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed
         compile mb_old_hash reason = runHsc hsc_env' $ do
             liftIO $ msg reason
             tc_result <- genericHscFrontend mod_summary
+            guts0 <- hscDesugar' (ms_location mod_summary) tc_result
             dflags <- getDynFlags
             case hscTarget dflags of
                 HscNothing -> return HscNotGeneratingCode
@@ -647,8 +648,7 @@ hscCompileOneShot hsc_env extCore_filename mod_summary src_changed
                            liftIO $ hscWriteIface dflags iface changed mod_summary
                            return HscUpdateBoot
                     _ ->
-                        do guts0 <- hscDesugar' (ms_location mod_summary) tc_result
-                           guts <- hscSimplify' guts0
+                        do guts <- hscSimplify' guts0
                            (iface, changed, _details, cgguts) <- hscNormalIface' extCore_filename guts mb_old_hash
                            liftIO $ hscWriteIface dflags iface changed mod_summary
                            return $ HscRecomp cgguts mod_summary






More information about the ghc-commits mailing list