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
bdd9ba64
Commit
bdd9ba64
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-05-26 05:01:45 by sof]
StrictnessInfo changed, added list of constructors the worker uses
parent
9fd7b8ed
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/basicTypes/IdInfo.lhs
+20
-11
20 additions, 11 deletions
ghc/compiler/basicTypes/IdInfo.lhs
with
20 additions
and
11 deletions
ghc/compiler/basicTypes/IdInfo.lhs
+
20
−
11
View file @
bdd9ba64
...
...
@@ -24,8 +24,7 @@ module IdInfo (
noDemandInfo, mkDemandInfo, demandInfo, ppDemandInfo, addDemandInfo, willBeDemanded,
StrictnessInfo(..), -- Non-abstract
Demand(..), -- Non-abstract
wwLazy, wwStrict, wwUnpack, wwPrim, wwEnum,
Demand(..), NewOrData, -- Non-abstract
getWorkerId_maybe,
workerExists,
...
...
@@ -58,13 +57,14 @@ IMPORT_DELOOPER(IdLoop) -- IdInfo is a dependency-loop ranch, and
-- except from the very general "utils".
import Type ( eqSimpleTy, splitFunTyExpandingDicts )
import BasicTypes ( NewOrData )
import CmdLineOpts ( opt_OmitInterfacePragmas )
import Demand
import Maybes ( firstJust )
import Outputable ( ifPprInterface, Outputable(..){-instances-} )
import PprStyle ( PprStyle(..) )
import Outputable ( ifaceStyle, PprStyle(..), Outputable(..){-instances-} )
import Pretty
import PprType ()
import Unique ( pprUnique )
import Util ( mapAccumL, panic, assertPanic, pprPanic )
...
...
@@ -326,13 +326,20 @@ data StrictnessInfo bdee
-- variants thereof.
| StrictnessInfo [Demand] -- The main stuff; see below.
(Maybe bdee) -- Worker's Id, if applicable.
-- (It may not be applicable because the strictness info
-- might say just "SSS" or something; so there's no w/w split.)
(Maybe (bdee,[bdee])) -- Worker's Id, if applicable, and a list of the constructors
-- mentioned by the wrapper. This is necessary so that the
-- renamer can slurp them in. Without this info, the renamer doesn't
-- know which data types to slurp in concretely. Remember, for
-- strict things we don't put the unfolding in the interface file, to save space.
-- This constructor list allows the renamer to behave much as if the
-- unfolding *was* in the interface file.
--
-- This field might be Nothing even for a strict fn because the strictness info
-- might say just "SSS" or something; so there's no w/w split.
\end{code}
\begin{code}
mkStrictnessInfo :: [Demand] -> Maybe bdee -> StrictnessInfo bdee
mkStrictnessInfo :: [Demand] -> Maybe
(
bdee
,[bdee])
-> StrictnessInfo bdee
mkStrictnessInfo xs wrkr
| all is_lazy xs = NoStrictnessInfo -- Uninteresting
...
...
@@ -359,8 +366,10 @@ ppStrictnessInfo sty (StrictnessInfo wrapper_args wrkr_maybe)
= hsep [ptext SLIT("_S_"), text (showList wrapper_args ""), pp_wrkr]
where
pp_wrkr = case wrkr_maybe of
Nothing -> empty
Just wrkr -> ppr sty wrkr
Nothing -> empty
Just (wrkr,cons) | ifaceStyle sty &&
not (null cons) -> pprId sty wrkr <+> braces (hsep (map (pprId sty) cons))
| otherwise -> pprId sty wrkr
\end{code}
...
...
@@ -370,7 +379,7 @@ workerExists (StrictnessInfo _ (Just worker_id)) = True
workerExists other = False
getWorkerId_maybe :: StrictnessInfo bdee -> Maybe bdee
getWorkerId_maybe (StrictnessInfo _
maybe_worker_id) = maybe_worker_id
getWorkerId_maybe (StrictnessInfo _
(Just (wrkr,_))) = Just wrkr
getWorkerId_maybe other = Nothing
\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