[commit: ghc] wip/binary-bytestring: IfaceEnv: Only check for built-in OccNames if mod is GHC.Types (524ff05)
git at git.haskell.org
git at git.haskell.org
Mon Jul 11 22:37:51 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/binary-bytestring
Link : http://ghc.haskell.org/trac/ghc/changeset/524ff05a7f36a0cc92be0afb9cac35ec9181e177/ghc
>---------------------------------------------------------------
commit 524ff05a7f36a0cc92be0afb9cac35ec9181e177
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.
>---------------------------------------------------------------
524ff05a7f36a0cc92be0afb9cac35ec9181e177
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