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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
alexbiehl-gc
GHC
Commits
a9b9e4b1
Commit
a9b9e4b1
authored
24 years ago
by
Simon Peyton Jones
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-10-30 10:04:51 by simonpj]
Fix Name
parent
2ecf1c9f
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/basicTypes/Name.lhs
+25
-21
25 additions, 21 deletions
ghc/compiler/basicTypes/Name.lhs
with
25 additions
and
21 deletions
ghc/compiler/basicTypes/Name.lhs
+
25
−
21
View file @
a9b9e4b1
...
...
@@ -201,22 +201,6 @@ mkCCallName :: Unique -> EncodedString -> Name
mkCCallName uniq str = Name { n_uniq = uniq, n_sort = Local,
n_occ = mkCCallOcc str, n_loc = noSrcLoc }
mkTopName :: Unique -> Module -> FAST_STRING -> Name
-- Make a top-level name; make it Global if top-level
-- things should be externally visible; Local otherwise
-- This chap is only used *after* the tidyCore phase
-- Notably, it is used during STG lambda lifting
--
-- We have to make sure that the name is globally unique
-- and we don't have tidyCore to help us. So we append
-- the unique. Hack! Hack!
-- (Used only by the STG lambda lifter.)
mkTopName uniq mod fs
= Name { n_uniq = uniq,
n_sort = mk_top_sort mod,
n_occ = mkVarOcc (_PK_ ((_UNPK_ fs) ++ show uniq)),
n_loc = noSrcLoc }
mkIPName :: Unique -> OccName -> Name
mkIPName uniq occ
= Name { n_uniq = uniq,
...
...
@@ -314,12 +298,32 @@ tidyTopName mod env
localise = (env', name')
(env', occ') = tidyOccName env occ
name' | all_toplev_ids_visible = name { n_occ = occ', n_sort = Global mod }
| otherwise = name { n_occ = occ' }
name' = name { n_occ = occ', n_sort = mkLocalTopSort mod }
mkTopName :: Unique -> Module -> FAST_STRING -> Name
-- Make a top-level name; make it Global if top-level
-- things should be externally visible; Local otherwise
-- This chap is only used *after* the tidyCore phase
-- Notably, it is used during STG lambda lifting
--
-- We have to make sure that the name is globally unique
-- and we don't have tidyCore to help us. So we append
-- the unique. Hack! Hack!
-- (Used only by the STG lambda lifter.)
mkTopName uniq mod fs
= Name { n_uniq = uniq,
n_sort = mkLocalTopSort mod,
n_occ = mkVarOcc (_PK_ ((_UNPK_ fs) ++ show uniq)),
n_loc = noSrcLoc }
mkLocalTopSort :: Module -> NameSort
mkLocalTopSort mod
| all_toplev_ids_visible = Global mod
| otherwise = Local
all_toplev_ids_visible
=
not opt_OmitInterfacePragmas || -- Pragmas can make them visible
opt_EnsureSplittableC -- Splitting requires visiblilty
all_toplev_ids_visible
=
not opt_OmitInterfacePragmas || -- Pragmas can make them visible
opt_EnsureSplittableC -- Splitting requires visiblilty
\end{code}
...
...
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