aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface/Create.hs
diff options
context:
space:
mode:
authorDavid Waern <davve@dtek.chalmers.se>2008-01-06 14:40:52 +0000
committerDavid Waern <davve@dtek.chalmers.se>2008-01-06 14:40:52 +0000
commit671ec1ad8aec260511887788338f186055ac52d1 (patch)
tree06a96219aa35f2e24be6837b822968b75c4aead2 /src/Haddock/Interface/Create.hs
parent64512e4a070a69359bc26d43670cec6abc672caa (diff)
Manual merge of a patch to the 0.8 branch
Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar@microsoft.com> * Source links must point to the original module, not the referring module
Diffstat (limited to 'src/Haddock/Interface/Create.hs')
-rw-r--r--src/Haddock/Interface/Create.hs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
index fba25fe2..d2e616cc 100644
--- a/src/Haddock/Interface/Create.hs
+++ b/src/Haddock/Interface/Create.hs
@@ -53,17 +53,19 @@ createInterface ghcMod flags modMap = do
| Flag_IgnoreAllExports `elem` flags = OptIgnoreExports : opts0
| otherwise = opts0
- let group = ghcGroup ghcMod
- entities = (nubBy sameName . getTopEntities) group
- exports = fmap (reverse . map unLoc) (ghcMbExports ghcMod)
- entityNames_ = entityNames entities
- subNames = allSubNames group
- localNames = entityNames_ ++ subNames
- subMap = mkSubMap group
- expDeclMap = mkDeclMap (ghcExportedNames ghcMod) group
- localDeclMap = mkDeclMap entityNames_ group
- docMap = mkDocMap group
- ignoreExps = Flag_IgnoreAllExports `elem` flags
+ let group = ghcGroup ghcMod
+ entities = (nubBy sameName . getTopEntities) group
+ exports = fmap (reverse . map unLoc) (ghcMbExports ghcMod)
+ entityNames_ = entityNames entities
+ subNames = allSubNames group
+ localNames = entityNames_ ++ subNames
+ subMap = mkSubMap group
+ expDeclMap = mkDeclMap (ghcExportedNames ghcMod) group
+ localDeclMap = mkDeclMap entityNames_ group
+ docMap = mkDocMap group
+ ignoreExps = Flag_IgnoreAllExports `elem` flags
+ exportedNames = ghcExportedNames ghcMod
+ origEnv = Map.fromList [ (nameOccName n, n) | n <- exportedNames ]
visibleNames <- mkVisibleNames mod modMap localNames
(ghcNamesInScope ghcMod)
@@ -92,8 +94,9 @@ createInterface ghcMod flags modMap = do
ifaceRnDocMap = Map.empty,
ifaceSubMap = subMap,
ifaceExportItems = prunedExportItems,
- ifaceRnExportItems = [],
- ifaceExports = ghcExportedNames ghcMod,
+ ifaceRnExportItems = [],
+ ifaceEnv = origEnv,
+ ifaceExports = exportedNames,
ifaceVisibleExports = visibleNames,
ifaceExportedDeclMap = expDeclMap,
ifaceInstances = ghcInstances ghcMod