GC dead code and export list entries.
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: AbsCSyn.lhs,v 1.55 2003/07/28 16:05:30 simonmar Exp $
+% $Id: AbsCSyn.lhs,v 1.56 2003/11/17 14:47:53 simonmar Exp $
%
\section[AbstractC]{Abstract C: the last stop before machine code}
@AbstractC@ is a list of Abstract~C statements, but the data structure
is tree-ish, for easier and more efficient putting-together.
\begin{code}
-absCNop = AbsCNop
-
data AbstractC
= AbsCNop
| AbsCStmts AbstractC AbstractC
type VirtualHeapOffset = HeapOffset
type VirtualSpOffset = Int
-
-type HpRelOffset = HeapOffset
-type SpRelOffset = Int
\end{code}
%************************************************************************
isTop, isAbsent, seqDemand,
DmdType(..), topDmdType, botDmdType, mkDmdType, mkTopDmdType,
- dmdTypeDepth, dmdTypeRes, seqDmdType,
+ dmdTypeDepth, seqDmdType,
DmdEnv, emptyDmdEnv,
DmdResult(..), retCPR, isBotRes, returnsCPR, resTypeArgDmd,
StrictSig(..), mkStrictSig, topSig, botSig, cprSig,
isTopSig,
- splitStrictSig, strictSigResInfo,
+ splitStrictSig,
pprIfaceStrictSig, appIsBottom, isBottomingSig, seqStrictSig,
) where
dmdTypeDepth :: DmdType -> Arity
dmdTypeDepth (DmdType _ ds _) = length ds
-
-dmdTypeRes :: DmdType -> DmdResult
-dmdTypeRes (DmdType _ _ res_ty) = res_ty
\end{code}
splitStrictSig :: StrictSig -> ([Demand], DmdResult)
splitStrictSig (StrictSig (DmdType _ dmds res)) = (dmds, res)
-strictSigResInfo :: StrictSig -> DmdResult
-strictSigResInfo (StrictSig (DmdType _ _ res)) = res
-
isTopSig (StrictSig ty) = isTopDmdType ty
topSig, botSig, cprSig :: StrictSig
\begin{code}
module CoreTidy (
- tidyBind, tidyExpr,
- tidyBndr, tidyBndrs, tidyVarOcc,
+ tidyExpr, tidyVarOcc,
tidyIdRules, pprTidyIdRules
) where
\begin{code}
module PprCore (
- pprCoreExpr, pprParendExpr, pprIdBndr,
+ pprCoreExpr, pprParendExpr,
pprCoreBinding, pprCoreBindings, pprCoreAlt,
- pprIdRules, pprCoreRule
+ pprIdRules
) where
#include "HsVersions.h"
\begin{code}
module Rules (
RuleBase, emptyRuleBase,
- extendRuleBase, extendRuleBaseList,
+ extendRuleBaseList,
ruleBaseIds, getLocalRules,
pprRuleBase, ruleCheckProgram,
StgOp(..),
-- SRTs
- SRT(..), noSRT, nonEmptySRT,
+ SRT(..),
-- utils
- stgBindHasCafRefs, stgArgHasCafRefs, stgRhsArity, getArgPrimRep,
+ stgArgHasCafRefs,
isDllConApp, isStgTypeArg,
- stgArgType, stgBinders,
+ stgArgType,
pprStgBinding, pprStgBindings, pprStgBindingsWithSRTs
data GenStgBinding bndr occ
= StgNonRec bndr (GenStgRhs bndr occ)
| StgRec [(bndr, GenStgRhs bndr occ)]
-
-stgBinders :: GenStgBinding bndr occ -> [bndr]
-stgBinders (StgNonRec b _) = [b]
-stgBinders (StgRec bs) = map fst bs
\end{code}
%************************************************************************
\end{code}
\begin{code}
-getArgPrimRep (StgVarArg local) = idPrimRep local
-getArgPrimRep (StgLitArg lit) = literalPrimRep lit
-
isStgTypeArg (StgTypeArg _) = True
isStgTypeArg other = False
\end{code}
\begin{code}
-stgRhsArity :: StgRhs -> Int
-stgRhsArity (StgRhsClosure _ _ _ _ _ bndrs _) = count isId bndrs
- -- The arity never includes type parameters, so
- -- when keeping type arguments and binders in the Stg syntax
- -- (opt_RuntimeTypes) we have to fliter out the type binders.
-stgRhsArity (StgRhsCon _ _ _) = 0
-\end{code}
-
-\begin{code}
-stgBindHasCafRefs :: GenStgBinding bndr Id -> Bool
-stgBindHasCafRefs (StgNonRec _ rhs) = rhsHasCafRefs rhs
-stgBindHasCafRefs (StgRec binds) = any rhsHasCafRefs (map snd binds)
-
rhsHasCafRefs (StgRhsClosure _ _ _ upd srt _ _)
= isUpdatable upd || nonEmptySRT srt
rhsHasCafRefs (StgRhsCon _ _ args)