[commit: ghc] master: Rename "changed" to "no-change" in HscMain (f2bad7e)

git at git.haskell.org git at git.haskell.org
Sat Dec 8 05:05:07 UTC 2018


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

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

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

commit f2bad7e1069e61955c16e4e73a254095807d863a
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Fri Dec 7 23:20:42 2018 -0500

    Rename "changed" to "no-change" in HscMain
    
    hscSimpleIface is returning a bool for whether there were _no changes_
    in the iface file. The same bool is called "no_change_at_all" in
    mkIface_, and "no_change" in hscWriteIface and other functions. However
    it is called "changed" in HscMain.finish and hscMaybeWriteIface, which
    is confusing because "changed" and "no_change" have opposite meanings.
    This patch renames "changed" to "no_change" to fix this.
    
    Reviewers: simonpj, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5416


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

f2bad7e1069e61955c16e4e73a254095807d863a
 compiler/main/HscMain.hs | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index d7cebd0..38dc727 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -743,10 +743,10 @@ finish summary tc_result mb_old_hash = do
                 (_, HsBootFile) -> HscUpdateBoot
                 (_, HsigFile) -> HscUpdateSig
                 _ -> panic "finish"
-        (iface, changed, details) <- liftIO $
+        (iface, no_change, details) <- liftIO $
           hscSimpleIface hsc_env tc_result mb_old_hash
-        return (iface, changed, details, hsc_status)
-  (iface, changed, details, hsc_status) <-
+        return (iface, no_change, details, hsc_status)
+  (iface, no_change, details, hsc_status) <-
     -- we usually desugar even when we are not generating code, otherwise
     -- we would miss errors thrown by the desugaring (see #10600). The only
     -- exceptions are when the Module is Ghc.Prim or when
@@ -761,25 +761,25 @@ finish summary tc_result mb_old_hash = do
           else do
             plugins <- liftIO $ readIORef (tcg_th_coreplugins tc_result)
             desugared_guts <- hscSimplify' plugins desugared_guts0
-            (iface, changed, details, cgguts) <-
+            (iface, no_change, details, cgguts) <-
               liftIO $ hscNormalIface hsc_env desugared_guts mb_old_hash
-            return (iface, changed, details, HscRecomp cgguts summary)
+            return (iface, no_change, details, HscRecomp cgguts summary)
       else mk_simple_iface
-  liftIO $ hscMaybeWriteIface dflags iface changed summary
+  liftIO $ hscMaybeWriteIface dflags iface no_change summary
   return
     ( hsc_status
     , HomeModInfo
       {hm_details = details, hm_iface = iface, hm_linkable = Nothing})
 
 hscMaybeWriteIface :: DynFlags -> ModIface -> Bool -> ModSummary -> IO ()
-hscMaybeWriteIface dflags iface changed summary =
+hscMaybeWriteIface dflags iface no_change summary =
     let force_write_interface = gopt Opt_WriteInterface dflags
         write_interface = case hscTarget dflags of
                             HscNothing      -> False
                             HscInterpreted  -> False
                             _               -> True
     in when (write_interface || force_write_interface) $
-            hscWriteIface dflags iface changed summary
+            hscWriteIface dflags iface no_change summary
 
 --------------------------------------------------------------
 -- NoRecomp handlers



More information about the ghc-commits mailing list