Don't expose the unfolding of dictionary selectors without -O
authorsimonpj@microsoft.com <unknown>
Thu, 6 Mar 2008 13:50:26 +0000 (13:50 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 6 Mar 2008 13:50:26 +0000 (13:50 +0000)
commit74d5597ec6069dab0aacb0b7c23d68b54d0f3bb4
tree3ee6564d6c8d059d41fcd241d580e3cf81885750
parent0a8ad35fdcee761755e53270b2474c9b13a055dd
Don't expose the unfolding of dictionary selectors without -O

When compiling without -O we were getting code like this

f x = case GHC.Base.$f20 of
  :DEq eq neq -> eq x x

But because of the -O the $f20 dictionary is not available, so exposing
the dictionary selector was useless.  Yet it makes the code bigger!
Better to get
f x = GHC.Base.== GHC.Bsae.$f20 x x

This patch suppresses the implicit unfolding for dictionary selectors
when compiling without -O.  We could do the same for other implicit
Ids, but this will do for now.

There should be no effect when compiling with -O.  Programs should
be smaller without -O and may run a tiny bit slower.
compiler/basicTypes/MkId.lhs
compiler/iface/BuildTyCl.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcTyClsDecls.lhs