Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
8111e8c5
Commit
8111e8c5
authored
24 years ago
by
Simon Peyton Jones
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-05-09 13:15:37 by simonpj]
Get package names right. Again.
parent
35cd30bf
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/rename/RnEnv.lhs
+24
-6
24 additions, 6 deletions
ghc/compiler/rename/RnEnv.lhs
with
24 additions
and
6 deletions
ghc/compiler/rename/RnEnv.lhs
+
24
−
6
View file @
8111e8c5
...
...
@@ -149,15 +149,33 @@ mkImportedGlobalName mod_name occ
new_cache = addToFM cache key name
updateProvenances :: [Name] -> RnM d ()
-- Update the provenances of everything that is in scope.
-- We must be careful not to disturb the Module package info
-- already in the cache. Why not? Consider
-- module A module M( f )
-- import M( f ) import N( f)
-- import N
-- So f is defined in N, and M re-exports it.
-- When processing module A:
-- 1. We read M.hi first, and make a vanilla name N.f
-- (without reading N.hi). The package info says <THIS>
-- for lack of anything better.
-- 2. Now we read N, which update the cache to record
-- the correct package for N.f.
-- 3. Finally we update provenances (once we've read all imports).
-- Step 3 must not destroy package info recorded in Step 2.
updateProvenances names
= getNameSupplyRn `thenRn` \ (us, inst_ns, cache, ipcache) ->
setNameSupplyRn (us, inst_ns, update cache names, ipcache)
setNameSupplyRn (us, inst_ns,
foldr
update cache names, ipcache)
where
update cache [] = cache
update cache (name:names) = WARN( not (key `elemFM` cache), ppr name )
update (addToFM cache key name) names
where
key = (moduleName (nameModule name), nameOccName name)
update name cache = addToFM_C update_prov cache key name
where
key = (moduleName (nameModule name), nameOccName name)
update_prov name_in_cache name_with_prov
= setNameProvenance name_in_cache (getNameProvenance name_with_prov)
mkImportedGlobalFromRdrName :: RdrName -> RnM d Name
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment