[commit: ghc] wip/occname: IfaceEnv: Only check for built-in OccNames if mod is GHC.Types (f4de155)

git at git.haskell.org git at git.haskell.org
Tue Jul 12 15:23:41 UTC 2016


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

On branch  : wip/occname
Link       : http://ghc.haskell.org/trac/ghc/changeset/f4de1552d6455d53fba89cde3b67e2307ecc82cc/ghc

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

commit f4de1552d6455d53fba89cde3b67e2307ecc82cc
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Jul 11 18:41:40 2016 +0200

    IfaceEnv: Only check for built-in OccNames if mod is GHC.Types
    
    This check is not entirely cheap and will not succeed unless we are
    looking for something in the module where built-in syntax lives,
    GHC.Types.


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

f4de1552d6455d53fba89cde3b67e2307ecc82cc
 compiler/iface/IfaceEnv.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/iface/IfaceEnv.hs b/compiler/iface/IfaceEnv.hs
index 0c8d8e9..b70c8e9 100644
--- a/compiler/iface/IfaceEnv.hs
+++ b/compiler/iface/IfaceEnv.hs
@@ -33,6 +33,7 @@ import Module
 import FastString
 import FastStringEnv
 import IfaceType
+import PrelNames ( gHC_TYPES )
 import UniqSupply
 import SrcLoc
 import Util
@@ -203,7 +204,8 @@ However, there are two reasons why we might look up an Orig RdrName:
 
 lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name
 lookupOrigNameCache nc mod occ
-  | Just name <- isBuiltInOcc_maybe occ
+  | mod == gHC_TYPES
+  , Just name <- isBuiltInOcc_maybe occ
   =     -- See Note [Known-key names], 3(c) in PrelNames
         -- Special case for tuples; there are too many
         -- of them to pre-populate the original-name cache



More information about the ghc-commits mailing list