Make the integer library to use more configurable
[ghc-hetmet.git] / compiler / stgSyn / CoreToStg.lhs
index 529de77..4956ccc 100644 (file)
@@ -39,6 +39,8 @@ import StaticFlags    ( opt_RuntimeTypes )
 import Module
 import Outputable
 import MonadUtils
+import FastString
+import Util
 \end{code}
 
 %************************************************************************
@@ -187,7 +189,7 @@ coreTopBindToStg this_pkg env body_fvs (NonRec id rhs)
        bind = StgNonRec id stg_rhs
     in
     ASSERT2(manifestArity rhs == stgRhsArity stg_rhs, ppr id $$ (ptext SLIT("rhs:")) <+> ppr rhs $$ (ptext SLIT("stg_rhs:"))<+> ppr stg_rhs $$ (ptext SLIT("Manifest:")) <+> (ppr $ manifestArity rhs) $$ (ptext SLIT("STG:")) <+>(ppr $ stgRhsArity stg_rhs) )
-    ASSERT2(consistentCafInfo id bind, ppr id)
+    ASSERT2(consistentCafInfo id bind, ppr id $$ ppr rhs $$ ppr bind)
 --    WARN(not (consistent caf_info bind), ppr id <+> ppr cafs <+> ppCafInfo caf_info)
     (env', fvs' `unionFVInfo` body_fvs, bind)
 
@@ -636,16 +638,12 @@ coreToStgLet let_no_escape bind body = do
 
        no_binder_escapes = isEmptyVarSet (set_of_binders `intersectVarSet` all_escs)
 
-#ifdef DEBUG
        -- Debugging code as requested by Andrew Kennedy
        checked_no_binder_escapes
-               | not no_binder_escapes && any is_join_var binders
+               | debugIsOn && not no_binder_escapes && any is_join_var binders
                = pprTrace "Interesting!  A join var that isn't let-no-escaped" (ppr binders)
                  False
                | otherwise = no_binder_escapes
-#else
-       checked_no_binder_escapes = no_binder_escapes
-#endif
                            
                -- Mustn't depend on the passed-in let_no_escape flag, since
                -- no_binder_escapes is used by the caller to derive the flag!