Skip to content
  • Simon Marlow's avatar
    [project @ 2003-03-21 13:54:27 by simonmar] · 2e6d322e
    Simon Marlow authored
    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.
    2e6d322e