Fix an ASSERT failure with profiling
authorsimonpj@microsoft.com <unknown>
Wed, 22 Sep 2010 13:37:41 +0000 (13:37 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 22 Sep 2010 13:37:41 +0000 (13:37 +0000)
commit9e6ca39b5e90b7a4acc755e3e95cc3ef60940070
tree44eac4d23601a32cca0855477fd96041be26b19a
parent2d874edca55c4f1761a111dc068d17b319cf707e
Fix an ASSERT failure with profiling

The problem arose with this kind of thing

   x = (,) (scc "blah" Nothing)

Then 'x' is marked NoCafRefs by CoreTidy, becuase it has
arity 1, and doesn't mention any caffy things.

That in turns means that CorePrep must not float out the
sat binding to give

  sat = scc "blah" Nothing
  x = (,) sat

Rather we must generate

  x = \eta. let sat = scc "blah" Nothing
            in (,) sat eta

URGH! This Caf stuff is such a mess.
compiler/coreSyn/CorePrep.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/main/Packages.lhs
compiler/main/TidyPgm.lhs
compiler/stgSyn/CoreToStg.lhs
compiler/stgSyn/StgSyn.lhs