Code bloat for instances of empty classes
|Reported by:||wolfgang||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
TcInstDcls has a special case for empty classes that leads to a seemingly unnecessary increase in code size. Comments refer to CCallable and CReturnable, so I think this is just a leftover; removing it didn't cause any crashes for me, but a Wizard who knows the code should have a short glance at it first.
Index: ghc/compiler/typecheck/TcInstDcls.lhs =================================================================== RCS file: /home/cvs/root/fptools/ghc/compiler/typecheck/TcInstDcls.lhs,v retrieving revision 1.182 diff -u -r1.182 TcInstDcls.lhs --- ghc/compiler/typecheck/TcInstDcls.lhs 6 Jan 2006 16:30:19 -0000 1.182 +++ ghc/compiler/typecheck/TcInstDcls.lhs 17 Jan 2006 02:18:19 -0000 @@ -395,18 +395,6 @@ -- See Note [Inline dfuns] below dict_rhs - | null scs_and_meths - = -- Blatant special case for CCallable, CReturnable - -- If the dictionary is empty then we should never - -- select anything from it, so we make its RHS just - -- emit an error message. This in turn means that we don't - -- mention the constructor, which doesn't exist for CCallable, CReturnable - -- Hardly beautiful, but only three extra lines. - nlHsApp (noLoc $ TyApp (nlHsVar rUNTIME_ERROR_ID) - [idType this_dict_id]) - (nlHsLit (HsStringPrim (mkFastString msg))) - - | otherwise -- The common case = mkHsConApp dict_constr inst_tys' (map HsVar scs_and_meths) -- We don't produce a binding for the dict_constr; instead we -- rely on the simplifier to unfold this saturated application