[commit: ghc] master: Remove unnecessary loadInterface for TH quoted name. (640fe14)

git at git.haskell.org git at git.haskell.org
Thu May 28 17:25:29 UTC 2015


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

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

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

commit 640fe14255706ab9c6a1fa101d9b05dfabdc6556
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Thu May 14 15:49:44 2015 -0700

    Remove unnecessary loadInterface for TH quoted name.
    
    Summary:
    The load was introduced a32d3e4da0aceb624c958f02cad7327e17ac94db
    to fix a bug where deprecations assumed that the name in question
    had already had their interface loaded.  The new deprecation
    code no longer makes this assumption and just loads the interface,
    so this eager load is not necessary.
    
    Verified that TH_reifyType2 continues to work.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: simonpj, austin
    
    Subscribers: bgamari, thomie
    
    Differential Revision: https://phabricator.haskell.org/D891
    
    GHC Trac Issues: #10419


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

640fe14255706ab9c6a1fa101d9b05dfabdc6556
 compiler/rename/RnSplice.hs | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/compiler/rename/RnSplice.hs b/compiler/rename/RnSplice.hs
index 737dcc9..61b5b14 100644
--- a/compiler/rename/RnSplice.hs
+++ b/compiler/rename/RnSplice.hs
@@ -22,7 +22,6 @@ import Kind
 import RnEnv
 import RnSource         ( rnSrcDecls, findSplice )
 import RnPat            ( rnPat )
-import LoadIface        ( loadInterfaceForName )
 import BasicTypes       ( TopLevelFlag, isTopLevel )
 import Outputable
 import Module
@@ -98,10 +97,8 @@ rn_bracket outer_stage br@(VarBr flg rdr_name)
   = do { name <- lookupOccRn rdr_name
        ; this_mod <- getModule
 
-       ; case flg of
-           { -- Type variables can be quoted in TH. See #5721.
-             False -> return ()
-           ; True | nameIsLocalOrFrom this_mod name ->
+       ; when (flg && nameIsLocalOrFrom this_mod name) $
+             -- Type variables can be quoted in TH. See #5721.
                  do { mb_bind_lvl <- lookupLocalOccThLvl_maybe name
                     ; case mb_bind_lvl of
                         { Nothing -> return ()      -- Can happen for data constructors,
@@ -116,15 +113,7 @@ rn_bracket outer_stage br@(VarBr flg rdr_name)
                                              (quotedNameStageErr br) }
                         }
                     }
-           ; True | otherwise ->  -- Imported thing
-                 discardResult (loadInterfaceForName msg name)
-                     -- Reason for loadInterface: deprecation checking
-                     -- assumes that the home interface is loaded, and
-                     -- this is the only way that is going to happen
-           }
        ; return (VarBr flg name, unitFV name) }
-  where
-    msg = ptext (sLit "Need interface for Template Haskell quoted Name")
 
 rn_bracket _ (ExpBr e) = do { (e', fvs) <- rnLExpr e
                             ; return (ExpBr e', fvs) }



More information about the ghc-commits mailing list