summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-12-17 11:53:59 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-17 17:35:24 -0500
commit0af959b1999b48f3b8e6c47184b6f8c80b4c452d (patch)
tree9251558436e7a42a8b9ee165b2110bbe44408df9
parentd88efb7048160c3031eadb4f3b729e9fe406414d (diff)
downloadhaskell-0af959b1999b48f3b8e6c47184b6f8c80b4c452d.tar.gz
Revert "Do not init record accessors as exported"
This reverts commit 3a00ff92a3ee66c096b85b180d247d1a471a6b6e due to #12993
-rw-r--r--compiler/basicTypes/Id.hs7
-rw-r--r--compiler/deSugar/Desugar.hs5
-rw-r--r--compiler/typecheck/TcTyDecls.hs7
-rw-r--r--testsuite/tests/th/all.T3
4 files changed, 3 insertions, 19 deletions
diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs
index b2be2c0343..1b84acda75 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,
@@ -286,12 +285,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 e73f12f19c..1e117b3c00 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -304,10 +304,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 e8046c7876..ae9f16d70f 100644
--- a/compiler/typecheck/TcTyDecls.hs
+++ b/compiler/typecheck/TcTyDecls.hs
@@ -806,12 +806,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
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index bb11528a5e..ce4c5f58c8 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -445,5 +445,4 @@ test('T12788', extra_clean(['T12788_Lib.hi', 'T12788_Lib.o']),
multimod_compile_fail,
['T12788.hs', '-v0 ' + config.ghc_th_way_flags])
test('T12977', normal, compile, ['-v0'])
-test('T12993', expect_broken(12993), multimod_compile,
- ['T12993.hs', '-v0']) \ No newline at end of file
+test('T12993', normal, multimod_compile, ['T12993.hs', '-v0']) \ No newline at end of file