[commit: ghc] ghc-8.0: Revert "Do not init record accessors as exported" (de122b0)

git at git.haskell.org git at git.haskell.org
Sun Dec 18 21:26:50 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/de122b0162ea0b8c145b9d6ebb1543c964d2c80c/ghc

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

commit de122b0162ea0b8c145b9d6ebb1543c964d2c80c
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Dec 17 11:52:59 2016 -0500

    Revert "Do not init record accessors as exported"
    
    This reverts commit 9d9eaeca03e138e0b35351c9401c832996398641 due
    to #12993.


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

de122b0162ea0b8c145b9d6ebb1543c964d2c80c
 compiler/basicTypes/Id.hs       | 7 -------
 compiler/deSugar/Desugar.hs     | 5 +----
 compiler/typecheck/TcTyDecls.hs | 7 +------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs
index 990a192..e55259b 100644
--- a/compiler/basicTypes/Id.hs
+++ b/compiler/basicTypes/Id.hs
@@ -33,7 +33,6 @@ module Id (
         mkLocalId, mkLocalCoVar, mkLocalIdOrCoVar,
         mkLocalIdOrCoVarWithInfo,
         mkLocalIdWithInfo, mkExportedLocalId, mkExportedVanillaId,
-        mkNonExportedLocalId,
         mkSysLocal, mkSysLocalM, mkSysLocalOrCoVar, mkSysLocalOrCoVarM,
         mkUserLocal, mkUserLocalOrCoVar,
         mkTemplateLocals, mkTemplateLocalsNum, mkTemplateLocal,
@@ -288,12 +287,6 @@ mkExportedLocalId :: IdDetails -> Name -> Type -> Id
 mkExportedLocalId details name ty = Var.mkExportedLocalVar details name ty vanillaIdInfo
         -- Note [Free type variables]
 
--- | Create a local 'Id' that is marked as not-exported.
--- These may be removed as dead code.
-mkNonExportedLocalId :: IdDetails -> Name -> Type -> Id
-mkNonExportedLocalId details name ty =
-  Var.mkLocalVar details name ty vanillaIdInfo
-
 mkExportedVanillaId :: Name -> Type -> Id
 mkExportedVanillaId name ty = Var.mkExportedLocalVar VanillaId name ty vanillaIdInfo
         -- Note [Free type variables]
diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs
index 365e7c9..db4c867 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -295,10 +295,7 @@ deSugar hsc_env
                      (text "Desugar"<+>brackets (ppr mod))
                      (const ()) $
      do { -- Desugar the program
-        ; let export_set =
-                -- Used to be 'availsToNameSet', but we now export selectors
-                -- only when necessary. See #12125.
-                availsToNameSetWithSelectors exports
+        ; let export_set = availsToNameSet exports
               target     = hscTarget dflags
               hpcInfo    = emptyHpcInfo other_hpc_info
 
diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs
index 4623744..233857c 100644
--- a/compiler/typecheck/TcTyDecls.hs
+++ b/compiler/typecheck/TcTyDecls.hs
@@ -949,12 +949,7 @@ mkOneRecordSelector all_cons idDetails fl
     lbl      = flLabel fl
     sel_name = flSelector fl
 
-    sel_id =
-      -- Do not mark record selectors as exported to avoid keeping these Ids
-      -- alive unnecessarily. See #12125. Selectors are now marked as exported
-      -- when necessary by desugarer ('Desugar.addExportFlagsAndRules', also see
-      -- uses of 'availsToNameSetWithSelectors' in 'Desugar.hs').
-      mkNonExportedLocalId rec_details sel_name sel_ty
+    sel_id = mkExportedLocalId rec_details sel_name sel_ty
     rec_details = RecSelId { sel_tycon = idDetails, sel_naughty = is_naughty }
 
     -- Find a representative constructor, con1



More information about the ghc-commits mailing list