-data Graph m l = Graph (ZTail m l) (BlockEnv (Block m l))
-
-data LGraph m l = LGraph { lg_entry :: BlockId
- , lg_blocks :: BlockEnv (Block m l) }
+-- For each block, we may need two pieces of information about the stack:
+-- 1. If the block is a procpoint, how many bytes are used to pass
+-- arguments on the stack?
+-- 2. If the block succeeds a call, we need to generate an infotable
+-- that describes the stack layout... but only up to the update frame!
+-- Note that a block can be a proc point without requiring an infotable.
+data StackInfo = StackInfo { argBytes :: Maybe Int
+ , returnOff :: Maybe Int }
+ deriving ( Eq )
+emptyStackInfo :: StackInfo
+emptyStackInfo = StackInfo Nothing Nothing
+
+data Block m l = Block { bid :: BlockId
+ , stackInfo :: StackInfo
+ , tail :: ZTail m l }
+
+data Graph m l = Graph { g_entry :: (ZTail m l), g_blocks :: (BlockEnv (Block m l)) }
+
+data LGraph m l = LGraph { lg_entry :: BlockId
+ , lg_argoffset :: Int -- space (bytes) for incoming args
+ , lg_blocks :: BlockEnv (Block m l)}