Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,321
Issues
4,321
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
362
Merge Requests
362
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
150e0a93
Commit
150e0a93
authored
Dec 08, 2000
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2000-12-08 12:56:00 by simonpj]
Get CAF info right
parent
b302643c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
34 deletions
+35
-34
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/basicTypes/Id.lhs
+1
-16
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/basicTypes/IdInfo.lhs
+23
-16
ghc/compiler/coreSyn/CoreTidy.lhs
ghc/compiler/coreSyn/CoreTidy.lhs
+10
-1
ghc/compiler/typecheck/TcEnv.lhs
ghc/compiler/typecheck/TcEnv.lhs
+1
-1
No files found.
ghc/compiler/basicTypes/Id.lhs
View file @
150e0a93
...
...
@@ -280,15 +280,6 @@ file, even if it's mentioned in some other interface unfolding.
\begin{code}
isImplicitId :: Id -> Bool
isImplicitId id
= ASSERT2( not (omit && nameIsLocallyDefined (idName id)
&& idTyGenInfo id /= TyGenNever),
ppr id )
-- mustn't omit type signature for a name whose type might change!
omit
where
omit = isImplicitId' id
isImplicitId' id
= case idFlavour id of
RecordSelId _ -> True -- Includes dictionary selectors
PrimOpId _ -> True
...
...
@@ -298,13 +289,7 @@ isImplicitId' id
-- remember that all type and class decls appear in the interface file.
-- The dfun id must *not* be omitted, because it carries version info for
-- the instance decl
ConstantId -> False -- Ordinary Ids
DictFunId -> False
ExportedId -> False -- I don't think these happen
VanillaId -> False -- ditto
SpecPragmaId -> False -- ditto
other -> False
\end{code}
\begin{code}
...
...
ghc/compiler/basicTypes/IdInfo.lhs
View file @
150e0a93
...
...
@@ -208,26 +208,33 @@ zapSpecPragInfo info = case flavourInfo info of
\begin{code}
vanillaIdInfo :: IdInfo
vanillaIdInfo = mkIdInfo VanillaId
-- Used for locally-defined Ids
-- We are going to calculate correct CAF information at the end
vanillaIdInfo = mkIdInfo VanillaId NoCafRefs
constantIdInfo :: IdInfo
constantIdInfo = mkIdInfo ConstantId
-- Used for imported Ids
-- The default is that they *do* have CAFs; an interface-file pragma
-- may say "oh no it doesn't", but in the absence of such a pragma
-- we'd better assume it does
constantIdInfo = mkIdInfo ConstantId MayHaveCafRefs
mkIdInfo :: IdFlavour -> IdInfo
mkIdInfo flv = IdInfo {
flavourInfo = flv,
arityInfo = UnknownArity,
demandInfo = wwLazy,
specInfo = emptyCoreRules,
tyGenInfo = noTyGenInfo,
workerInfo = NoWorker,
strictnessInfo = NoStrictnessInfo,
unfoldingInfo = noUnfolding,
cafInfo = NoCafRefs,
cprInfo = NoCPRInfo,
lbvarInfo = NoLBVarInfo,
inlinePragInfo = NoInlinePragInfo,
occInfo = NoOccInfo
mkIdInfo flv caf
= IdInfo {
flavourInfo = flv,
arityInfo = UnknownArity,
demandInfo = wwLazy,
specInfo = emptyCoreRules,
tyGenInfo = noTyGenInfo,
workerInfo = NoWorker,
strictnessInfo = NoStrictnessInfo,
unfoldingInfo = noUnfolding,
cafInfo = caf
cprInfo = NoCPRInfo,
lbvarInfo = NoLBVarInfo,
inlinePragInfo = NoInlinePragInfo,
occInfo = NoOccInfo
}
\end{code}
...
...
ghc/compiler/coreSyn/CoreTidy.lhs
View file @
150e0a93
...
...
@@ -94,10 +94,19 @@ binder
that all Ids are unique, rather than the weaker guarantee of
no clashes which the simplifier provides.
- Give the Id its final IdInfo; in ptic,
- Give each dynamic CCall occurrence a fresh unique; this is
rather like the cloning step above.
- Give the Id its UTTERLY FINAL IdInfo; in ptic,
* Its flavour becomes ConstantId, reflecting the fact that
from now on we regard it as a constant, not local, Id
* its unfolding, if it should have one
* its arity, computed from the number of visible lambdas
* its CAF info, computed from what is free in its RHS
Finally, substitute these new top-level binders consistently
throughout, including in unfoldings. We also tidy binders in
...
...
ghc/compiler/typecheck/TcEnv.lhs
View file @
150e0a93
...
...
@@ -206,7 +206,7 @@ tcAddImportedIdInfo env id
-- The Id must be returned without a data dependency on maybe_id
where
new_info = case tcLookupRecId_maybe env (idName id) of
Nothing -> constantIdInfo
Nothing ->
pprTrace "tcAddIdInfo" (ppr id)
constantIdInfo
Just imported_id -> idInfo imported_id
-- ToDo: could check that types are the same
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment