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
8c0bd142
Commit
8c0bd142
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-07-12 14:40:08 by simonmar]
Keep the original name for non-exported record selectors and class methods.
parent
90bf51fc
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/compiler/basicTypes/Id.lhs
+7
-0
7 additions, 0 deletions
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/coreSyn/CoreTidy.lhs
+4
-4
4 additions, 4 deletions
ghc/compiler/coreSyn/CoreTidy.lhs
with
11 additions
and
4 deletions
ghc/compiler/basicTypes/Id.lhs
+
7
−
0
View file @
8c0bd142
...
...
@@ -22,6 +22,7 @@ module Id (
-- Predicates
omitIfaceSigForId,
exportWithOrigOccName,
externallyVisibleId,
idFreeTyVars,
...
...
@@ -248,6 +249,12 @@ omitIfaceSigForId id
-- the instance decl
other -> False -- Don't omit!
-- Certain names must be exported with their original occ names, because
-- these names are bound by either a class declaration or a data declaration
-- or an explicit user export.
exportWithOrigOccName :: Id -> Bool
exportWithOrigOccName id = omitIfaceSigForId id || isUserExportedId id
\end{code}
...
...
This diff is collapsed.
Click to expand it.
ghc/compiler/coreSyn/CoreTidy.lhs
+
4
−
4
View file @
8c0bd142
...
...
@@ -21,7 +21,7 @@ import VarEnv
import VarSet
import Var ( Id, IdOrTyVar )
import Id ( idType, idInfo, idName,
mkVanillaId, mkId,
isUserExportedId
,
mkVanillaId, mkId,
exportWithOrigOccName
,
getIdStrictness, setIdStrictness,
getIdDemandInfo, setIdDemandInfo,
)
...
...
@@ -94,7 +94,7 @@ tidyCorePgm us module_name binds_in rules
-- decl. tidyTopId then does a no-op on exported binders.
init_tidy_env = (initTidyOccEnv avoids, emptyVarEnv)
avoids = [getOccName bndr | bndr <- bindersOfBinds binds_in,
isUserExportedId
bndr]
exportWithOrigOccName
bndr]
tidyBind :: Maybe Module -- (Just m) for top level, Nothing for nested
-> TidyEnv
...
...
@@ -207,8 +207,8 @@ tidyTopId :: Module -> TidyEnv -> TidyEnv -> Id -> (TidyEnv, Id)
tidyTopId mod env@(tidy_env, var_env) env_idinfo id
= -- Top level variables
let
(tidy_env', name') |
isUserExportedId
id = (tidy_env, idName id)
| otherwise = tidyTopName mod tidy_env (idName id)
(tidy_env', name') |
exportWithOrigOccName
id = (tidy_env, idName id)
| otherwise
= tidyTopName mod tidy_env (idName id)
ty' = tidyTopType (idType id)
idinfo' = tidyIdInfo env_idinfo (idInfo id)
id' = mkId name' ty' idinfo'
...
...
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