Commit 0af959b1 authored by Ben Gamari's avatar Ben Gamari 🐢

Revert "Do not init record accessors as exported"

This reverts commit 3a00ff92 due
to #12993
parent d88efb70
...@@ -33,7 +33,6 @@ module Id ( ...@@ -33,7 +33,6 @@ module Id (
mkLocalId, mkLocalCoVar, mkLocalIdOrCoVar, mkLocalId, mkLocalCoVar, mkLocalIdOrCoVar,
mkLocalIdOrCoVarWithInfo, mkLocalIdOrCoVarWithInfo,
mkLocalIdWithInfo, mkExportedLocalId, mkExportedVanillaId, mkLocalIdWithInfo, mkExportedLocalId, mkExportedVanillaId,
mkNonExportedLocalId,
mkSysLocal, mkSysLocalM, mkSysLocalOrCoVar, mkSysLocalOrCoVarM, mkSysLocal, mkSysLocalM, mkSysLocalOrCoVar, mkSysLocalOrCoVarM,
mkUserLocal, mkUserLocalOrCoVar, mkUserLocal, mkUserLocalOrCoVar,
mkTemplateLocals, mkTemplateLocalsNum, mkTemplateLocal, mkTemplateLocals, mkTemplateLocalsNum, mkTemplateLocal,
...@@ -286,12 +285,6 @@ mkExportedLocalId :: IdDetails -> Name -> Type -> Id ...@@ -286,12 +285,6 @@ mkExportedLocalId :: IdDetails -> Name -> Type -> Id
mkExportedLocalId details name ty = Var.mkExportedLocalVar details name ty vanillaIdInfo mkExportedLocalId details name ty = Var.mkExportedLocalVar details name ty vanillaIdInfo
-- Note [Free type variables] -- 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 -> Type -> Id
mkExportedVanillaId name ty = Var.mkExportedLocalVar VanillaId name ty vanillaIdInfo mkExportedVanillaId name ty = Var.mkExportedLocalVar VanillaId name ty vanillaIdInfo
-- Note [Free type variables] -- Note [Free type variables]
......
...@@ -304,10 +304,7 @@ deSugar hsc_env ...@@ -304,10 +304,7 @@ deSugar hsc_env
(text "Desugar"<+>brackets (ppr mod)) (text "Desugar"<+>brackets (ppr mod))
(const ()) $ (const ()) $
do { -- Desugar the program do { -- Desugar the program
; let export_set = ; let export_set = availsToNameSet exports
-- Used to be 'availsToNameSet', but we now export selectors
-- only when necessary. See #12125.
availsToNameSetWithSelectors exports
target = hscTarget dflags target = hscTarget dflags
hpcInfo = emptyHpcInfo other_hpc_info hpcInfo = emptyHpcInfo other_hpc_info
......
...@@ -806,12 +806,7 @@ mkOneRecordSelector all_cons idDetails fl ...@@ -806,12 +806,7 @@ mkOneRecordSelector all_cons idDetails fl
lbl = flLabel fl lbl = flLabel fl
sel_name = flSelector fl sel_name = flSelector fl
sel_id = sel_id = mkExportedLocalId rec_details sel_name sel_ty
-- 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
rec_details = RecSelId { sel_tycon = idDetails, sel_naughty = is_naughty } rec_details = RecSelId { sel_tycon = idDetails, sel_naughty = is_naughty }
-- Find a representative constructor, con1 -- Find a representative constructor, con1
......
...@@ -445,5 +445,4 @@ test('T12788', extra_clean(['T12788_Lib.hi', 'T12788_Lib.o']), ...@@ -445,5 +445,4 @@ test('T12788', extra_clean(['T12788_Lib.hi', 'T12788_Lib.o']),
multimod_compile_fail, multimod_compile_fail,
['T12788.hs', '-v0 ' + config.ghc_th_way_flags]) ['T12788.hs', '-v0 ' + config.ghc_th_way_flags])
test('T12977', normal, compile, ['-v0']) test('T12977', normal, compile, ['-v0'])
test('T12993', expect_broken(12993), multimod_compile, test('T12993', normal, multimod_compile, ['T12993.hs', '-v0'])
['T12993.hs', '-v0']) \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment