From: simonmar Date: Wed, 20 Dec 2000 10:35:33 +0000 (+0000) Subject: [project @ 2000-12-20 10:35:33 by simonmar] X-Git-Tag: Approximately_9120_patches~3038 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=b1604ac09c517187251509d53c61607a09b62873;p=ghc-hetmet.git [project @ 2000-12-20 10:35:33 by simonmar] ASSERT that thunks have the right CafInfo. --- diff --git a/ghc/compiler/codeGen/CodeGen.lhs b/ghc/compiler/codeGen/CodeGen.lhs index 66373b2..bf6177d 100644 --- a/ghc/compiler/codeGen/CodeGen.lhs +++ b/ghc/compiler/codeGen/CodeGen.lhs @@ -48,11 +48,15 @@ import BasicTypes ( TopLevelFlag(..) ) import UniqSupply ( mkSplitUniqSupply ) import ErrUtils ( dumpIfSet_dyn, showPass ) import Panic ( assertPanic ) + +#ifdef DEBUG +import Id ( idCafInfo ) +import IdInfo ( mayHaveCafRefs ) +import Outputable +#endif \end{code} \begin{code} - - codeGen :: DynFlags -> Module -- Module name -> [Module] -- Import names @@ -260,7 +264,11 @@ cgTopRhs bndr (StgRhsCon cc con args) forkStatics (cgTopRhsCon bndr con args) cgTopRhs bndr (StgRhsClosure cc bi srt fvs upd_flag args body) - = ASSERT(null fvs) -- There should be no free variables + = -- There should be no free variables + ASSERT(null fvs) + -- If the closure is a thunk, then the binder must be recorded as such. + ASSERT2(not (isUpdatable upd_flag) || mayHaveCafRefs (idCafInfo bndr), ppr bndr) + getSRTLabel `thenFC` \srt_label -> let lf_info = mkClosureLFInfo bndr TopLevel [{-no fvs-}] upd_flag args srt_label srt