summaryrefslogtreecommitdiff
path: root/compiler/iface/MkIface.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-11-13 16:18:24 -0800
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-11-16 15:32:56 -0800
commitac1a379363618a6f2f17fff65ce9129164b6ef30 (patch)
tree65a0154fa86cf8dda560f62ecc6ae7555da65ac7 /compiler/iface/MkIface.hs
parent9193629a6d8c7605ba81e62bc7f9a04a8ce65013 (diff)
downloadhaskell-ac1a379363618a6f2f17fff65ce9129164b6ef30.tar.gz
Revert "Unify hsig and hs-boot; add preliminary "hs-boot" merging."
Summary: This reverts commit 06d46b1e4507e09eb2a7a04998a92610c8dc6277. This also has a Haddock submodule update. Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1475
Diffstat (limited to 'compiler/iface/MkIface.hs')
-rw-r--r--compiler/iface/MkIface.hs47
1 files changed, 7 insertions, 40 deletions
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index a8d0344e77..98b8830e01 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -13,7 +13,6 @@ module MkIface (
-- including computing version information
mkIfaceTc,
- mkIfaceDirect,
writeIfaceFile, -- Write the interface file
@@ -154,35 +153,6 @@ mkIface hsc_env maybe_old_fingerprint mod_details
warns hpc_info self_trust
safe_mode usages mod_details
--- | Make an interface from a manually constructed 'ModIface'. We use
--- this when we are merging 'ModIface's. We assume that the 'ModIface'
--- has accurate entries but not accurate fingerprint information (so,
--- like @intermediate_iface@ in 'mkIface_'.)
-mkIfaceDirect :: HscEnv
- -> Maybe Fingerprint
- -> ModIface
- -> IO (ModIface, Bool)
-mkIfaceDirect hsc_env maybe_old_fingerprint iface0 = do
- -- Sort some things to make sure we're deterministic
- let intermediate_iface = iface0 {
- mi_exports = mkIfaceExports (mi_exports iface0),
- mi_insts = sortBy cmp_inst (mi_insts iface0),
- mi_fam_insts = sortBy cmp_fam_inst (mi_fam_insts iface0),
- mi_rules = sortBy cmp_rule (mi_rules iface0)
- }
- dflags = hsc_dflags hsc_env
- (final_iface, no_change_at_all)
- <- {-# SCC "versioninfo" #-}
- addFingerprints hsc_env maybe_old_fingerprint
- intermediate_iface
- (map snd (mi_decls iface0))
-
- -- Debug printing
- dumpIfSet_dyn dflags Opt_D_dump_hi "FINAL INTERFACE"
- (pprModIface final_iface)
-
- return (final_iface, no_change_at_all)
-
-- | make an interface from the results of typechecking only. Useful
-- for non-optimising compilation, or where we aren't generating any
-- object code at all ('HscNothing').
@@ -320,6 +290,11 @@ mkIface_ hsc_env maybe_old_fingerprint
return (final_iface, no_change_at_all)
where
+ cmp_rule = comparing ifRuleName
+ -- Compare these lexicographically by OccName, *not* by unique,
+ -- because the latter is not stable across compilations:
+ cmp_inst = comparing (nameOccName . ifDFun)
+ cmp_fam_inst = comparing (nameOccName . ifFamInstTcName)
dflags = hsc_dflags hsc_env
@@ -337,6 +312,8 @@ mkIface_ hsc_env maybe_old_fingerprint
deliberatelyOmitted :: String -> a
deliberatelyOmitted x = panic ("Deliberately omitted: " ++ x)
+ ifFamInstTcName = ifFamInstFam
+
flattenVectInfo (VectInfo { vectInfoVar = vVar
, vectInfoTyCon = vTyCon
, vectInfoParallelVars = vParallelVars
@@ -350,16 +327,6 @@ mkIface_ hsc_env maybe_old_fingerprint
, ifaceVectInfoParallelTyCons = nameSetElems vParallelTyCons
}
-cmp_rule :: IfaceRule -> IfaceRule -> Ordering
-cmp_rule = comparing ifRuleName
--- Compare these lexicographically by OccName, *not* by unique,
--- because the latter is not stable across compilations:
-cmp_inst :: IfaceClsInst -> IfaceClsInst -> Ordering
-cmp_inst = comparing (nameOccName . ifDFun)
-
-cmp_fam_inst :: IfaceFamInst -> IfaceFamInst -> Ordering
-cmp_fam_inst = comparing (nameOccName . ifFamInstFam)
-
-----------------------------
writeIfaceFile :: DynFlags -> FilePath -> ModIface -> IO ()
writeIfaceFile dflags hi_file_path new_iface