[project @ 2003-03-21 13:54:27 by simonmar]
authorsimonmar <unknown>
Fri, 21 Mar 2003 13:54:28 +0000 (13:54 +0000)
committersimonmar <unknown>
Fri, 21 Mar 2003 13:54:28 +0000 (13:54 +0000)
commit2e6d322e130a8c37807a14699bbcbf9eb08fc970
treec6440d3a41f907bc5cf1332db20736e161f2e7cb
parent63a5c6464d8961189263b19070affdab9051add6
[project @ 2003-03-21 13:54:27 by simonmar]
Modifications to the way we calculate CafInfo during tidying (again).

The previous hack of setting the CafInfo on all non-top-level bindings
to NoCafRefs was a hack, and it came back to bite us: when CorePrep
floats out a let to the top level it doesn't create a new binding, and
the existing let binder happens to say NoCafRefs which is unsafe.  It
was caught by an ASSERT in the CoreToStg when compiling the libraries
without -O - compiling without -O tends to result in more
opportunities for CorePrep to float things to the top level.

Now, we calculate CafInfo on the pre-tidied expressions, using the
mapping from Ids to Ids that is being built up during tidying.  This
avoids one loop, but will be slightly slower due to the extra lookups.
However, it means we don't need to set the CafInfo on non-top-level
binders to NoCafRefs.
ghc/compiler/coreSyn/CoreTidy.lhs
ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/main/TidyPgm.lhs
ghc/compiler/stgSyn/CoreToStg.lhs