X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplStg%2FStgSAT.lhs;h=3d82b27dc6f107d663a89f19ef915a94c5294d21;hb=e7498a3ee1d0484d02a9e86633cc179c76ebf36e;hp=80cdec4208ddcd619cb7c3c2227cf6281d7d1aca;hpb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;p=ghc-hetmet.git diff --git a/ghc/compiler/simplStg/StgSAT.lhs b/ghc/compiler/simplStg/StgSAT.lhs index 80cdec4..3d82b27 100644 --- a/ghc/compiler/simplStg/StgSAT.lhs +++ b/ghc/compiler/simplStg/StgSAT.lhs @@ -1,5 +1,5 @@ % -% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995 +% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996 % %************************************************************************ %* * @@ -31,27 +31,21 @@ useless as map' will be transformed back to what map was. \begin{code} #include "HsVersions.h" -module StgSAT ( - doStaticArgs, +module StgSAT ( doStaticArgs ) where - -- and to make the interface self-sufficient... - PlainStgProgram(..), StgExpr, StgBinding, Id - ) where +IMP_Ubiq(){-uitous-} -import IdEnv -import Maybes ( Maybe(..) ) import StgSyn -import SATMonad ( SATEnv(..), SATInfo(..), Arg(..), updSAEnv, insSAEnv, - SatM(..), initSAT, thenSAT, thenSAT_, - emptyEnvSAT, returnSAT, mapSAT ) -import StgSATMonad -import SplitUniq -import Util +import UniqSupply ( UniqSM(..) ) +import Util ( panic ) \end{code} \begin{code} -doStaticArgs :: PlainStgProgram -> SplitUniqSupply -> PlainStgProgram +doStaticArgs :: [StgBinding] -> UniqSupply -> [StgBinding] +doStaticArgs = panic "StgSAT.doStaticArgs" + +{- LATER: to end of file: doStaticArgs binds = initSAT (mapSAT sat_bind binds) where @@ -73,7 +67,7 @@ doStaticArgs binds \end{code} \begin{code} -satAtom (StgVarAtom v) +satAtom (StgVarArg v) = updSAEnv (Just (v,([],[]))) `thenSAT_` returnSAT () @@ -81,27 +75,27 @@ satAtom _ = returnSAT () \end{code} \begin{code} -satExpr :: PlainStgExpr -> SatM PlainStgExpr +satExpr :: StgExpr -> SatM StgExpr -satExpr e@(StgConApp con args lvs) +satExpr e@(StgCon con args lvs) = mapSAT satAtom args `thenSAT_` returnSAT e -satExpr e@(StgPrimApp op args lvs) +satExpr e@(StgPrim op args lvs) = mapSAT satAtom args `thenSAT_` returnSAT e -satExpr e@(StgApp (StgLitAtom _) _ _) +satExpr e@(StgApp (StgLitArg _) _ _) = returnSAT e -satExpr e@(StgApp (StgVarAtom v) args _) +satExpr e@(StgApp (StgVarArg v) args _) = updSAEnv (Just (v,([],map tagArg args))) `thenSAT_` mapSAT satAtom args `thenSAT_` returnSAT e - where - tagArg (StgVarAtom v) = Static v + where + tagArg (StgVarArg v) = Static v tagArg _ = NotStatic - + satExpr (StgCase expr lv1 lv2 uniq alts) = satExpr expr `thenSAT` \ expr' -> sat_alts alts `thenSAT` \ alts' -> @@ -172,15 +166,13 @@ satExpr (StgLet (StgRec binds) body) satExpr (StgSCC ty cc expr) = satExpr expr `thenSAT` \ expr' -> returnSAT (StgSCC ty cc expr') - --- ToDo: DPH stuff \end{code} \begin{code} satRhs rhs@(StgRhsCon cc v args) = returnSAT rhs -satRhs (StgRhsClosure cc bi fvs upd args body) + +satRhs (StgRhsClosure cc bi fvs upd args body) = satExpr body `thenSAT` \ body' -> returnSAT (StgRhsClosure cc bi fvs upd args body') - +-} \end{code} -