[add compilation phase info to grin structure
John Meacham <john@repetae.net>**20051024091118] hunk ./Grin/DeadFunctions.hs 3
-import Control.Monad.Identity
hunk ./Grin/DeadFunctions.hs 13
-import CharIO
hunk ./Grin/DeadFunctions.hs 86
-    Bool       -- ^ Whether to count indirect function calls. (used before eval\/apply inlining)
-    -> Stats   -- ^ stats to update with what was done
+    Stats   -- ^ stats to update with what was done
hunk ./Grin/DeadFunctions.hs 90
-deadFunctions indirect stats keeps grin = do
-    let (graph,lv,kv) = graphFromEdges [ (gf, functionName gf, functionCalls gf) |  gf <- map (getFunctionInfo (grinCafs grin) indirect) $ grinFunctions grin ]
+deadFunctions stats keeps grin = do
+    let (graph,lv,kv) = graphFromEdges [ (gf, functionName gf, functionCalls gf) |  gf <- map (getFunctionInfo (grinCafs grin) indirect ) $ grinFunctions grin ]
hunk ./Grin/DeadFunctions.hs 94
-        --la a = case Map.lookup a $ Map.fromList $  zip (sort $ fsts (grinFunctions grin)) [0..] of
+        -- | Whether to count indirect function calls. (used before eval\/apply inlining)
+        indirect = not $ phaseEvalInlined $ grinPhase grin
hunk ./Grin/FromE.hs 97
+    print (grinPhase grin)
hunk ./Grin/FromE.hs 163
-    --wdump FD.Grin $ do
-        --mapM_ putStrLn [ show (x, freeVarsL z :: [Tag]) | (x,_,z) <- ds ]
-        --mapM_ (putErrLn . render) $ map prettyFun ds'
hunk ./Grin/FromE.hs 164
+            grinPhase = PhaseInit,
hunk ./Grin/FromE.hs 166
-            --grinFunctions = (funcMain ,[], App funcInitCafs [] :>>= (Unit,Store main') :>>= (p1,gEval p1)): ds',
-            --grinFunctions = (funcMain ,(Tup [] :-> App funcInitCafs [] :>>= unit :-> main' :>>= n3 :-> App funcApply [n3,pworld__] )) : ds',
-            --grinFunctions = (funcMain ,(Tup [] :-> App funcInitCafs [] :>>= unit :->  main' :>>= n3 :-> App funcApply [n3,pworld__] :>>= n0 :-> Return unit )) : ds',
hunk ./Grin/FromE.hs 167
-            grinCafs = cafs -- [ (n,NodeC t []) | (n,t) <- cafs]
+            grinCafs = cafs
hunk ./Grin/Grin.hs 20
+    Phase(..),
+    phaseEvalInlined,
hunk ./Grin/Grin.hs 165
+
+data Phase = PhaseInit | PostInlineEval
+    deriving(Show,Eq,Ord,Enum)
+
+phaseEvalInlined PostInlineEval = True
+phaseEvalInlined _ = False
hunk ./Grin/Grin.hs 174
+    grinPhase :: Phase,
hunk ./Grin/PointsToAnalysis.hs 340
-    return grin { grinFunctions = map (mapSnd f) grinFunctions }
+    return grin { grinPhase = PostInlineEval, grinFunctions = map (mapSnd f) grinFunctions }
hunk ./Main.hs 409
-        x <- deadFunctions True stats [funcMain] x
+        x <- deadFunctions stats [funcMain] x
hunk ./Main.hs 431
-        x <- deadFunctions False stats [funcMain] x
+        x <- deadFunctions stats [funcMain] x