-
-For a constructor C, make a binding
-
- $wC = \x y -> $wC x y
-
-i.e. a curried constructor that allocates. This means that we can treat
-the worker for a constructor like any other function in the rest of the compiler.
-
-\begin{code}
-cgWorker data_con
- | isNullaryDataCon data_con
- = cgTopRhsCon work_id data_con []
-
- | otherwise
- = cgTopRhsClosure work_id
- subsumedCCS noBinderInfo NoSRT
- arg_ids rhs
- lf_info
- where
- work_id = dataConId data_con
- arg_ids = mkTemplateLocals (dataConRepArgTys data_con)
- rhs = StgConApp data_con [StgVarArg id | id <- arg_ids]
- lf_info = mkClosureLFInfo work_id TopLevel [{-no fvs-}] ReEntrant arg_ids
-\end{code}