Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
46a55650
Commit
46a55650
authored
Apr 19, 2000
by
simonmar
Browse files
[project @ 2000-04-19 16:51:08 by simonmar]
Space leak fix from Simon P.J.
parent
9900ff5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/simplCore/SimplCore.lhs
View file @
46a55650
...
...
@@ -265,17 +265,26 @@ simplifyPgm (imported_rule_ids, rule_lhs_fvs)
dumpIfSet opt_D_dump_occur_anal "Occurrence analysis"
(pprCoreBindings tagged_binds);
-- Simplify
let { (binds', counts') = initSmpl sw_chkr us1 imported_rule_ids
black_list_fn
(simplTopBinds tagged_binds);
-- SIMPLIFY
-- We do this with a *case* not a *let* because lazy pattern
-- matching bit us with bad space leak!
-- With a let, we ended up with
-- let
-- t = initSmpl ...
-- counts' = snd t
-- in
-- case t of {(_,counts') -> if counts'=0 then ...
-- So the conditional didn't force counts', because the
-- selection got duplicated. Sigh!
case initSmpl sw_chkr us1 imported_rule_ids black_list_fn
(simplTopBinds tagged_binds)
of { (binds', counts') -> do {
-- The imported_rule_ids are used by initSmpl to initialise
-- the in-scope set. That way, the simplifier will change any
-- occurrences of the imported id to the one in the imported_rule_ids
-- set, which are decorated with their rules.
all_counts = counts `plusSimplCount` counts'
} ;
let { all_counts = counts `plusSimplCount` counts' } ;
-- Stop if nothing happened; don't dump output
if isZeroSimplCount counts' then
...
...
@@ -312,7 +321,7 @@ simplifyPgm (imported_rule_ids, rule_lhs_fvs)
-- Else loop
else iteration us2 (iteration_no + 1) all_counts binds'
} }
} }
} }
where
(us1, us2) = splitUniqSupply us
\end{code}
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