Bake in ByteOff to ParamLocation, and remove ArgumentFormat synonym.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 13 Jun 2011 16:29:58 +0000 (17:29 +0100)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 13 Jun 2011 16:29:58 +0000 (17:29 +0100)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

compiler/cmm/CmmCallConv.hs
compiler/cmm/MkGraph.hs
compiler/cmm/cmm-notes

index 73ce529..c81b868 100644 (file)
@@ -1,6 +1,5 @@
 module CmmCallConv (
   ParamLocation(..),
 module CmmCallConv (
   ParamLocation(..),
-  ArgumentFormat,
   assignArgumentsPos
 ) where
 
   assignArgumentsPos
 ) where
 
@@ -19,21 +18,19 @@ import Outputable
 -- Calculate the 'GlobalReg' or stack locations for function call
 -- parameters as used by the Cmm calling convention.
 
 -- Calculate the 'GlobalReg' or stack locations for function call
 -- parameters as used by the Cmm calling convention.
 
-data ParamLocation a
+data ParamLocation
   = RegisterParam GlobalReg
   = RegisterParam GlobalReg
-  | StackParam a
+  | StackParam ByteOff
 
 
-instance (Outputable a) => Outputable (ParamLocation a) where
+instance Outputable ParamLocation where
   ppr (RegisterParam g) = ppr g
   ppr (StackParam p)    = ppr p
 
   ppr (RegisterParam g) = ppr g
   ppr (StackParam p)    = ppr p
 
-type ArgumentFormat a b = [(a, ParamLocation b)]
-
 -- | JD: For the new stack story, I want arguments passed on the stack to manifest as
 -- positive offsets in a CallArea, not negative offsets from the stack pointer.
 -- Also, I want byte offsets, not word offsets.
 -- | JD: For the new stack story, I want arguments passed on the stack to manifest as
 -- positive offsets in a CallArea, not negative offsets from the stack pointer.
 -- Also, I want byte offsets, not word offsets.
-assignArgumentsPos :: (Outputable a) => Convention -> (a -> CmmType) -> [a] ->
-                      ArgumentFormat a ByteOff
+assignArgumentsPos :: Convention -> (a -> CmmType) -> [a] ->
+                      [(a, ParamLocation)]
 -- Given a list of arguments, and a function that tells their types,
 -- return a list showing where each argument is passed
 assignArgumentsPos conv arg_ty reps = assignments
 -- Given a list of arguments, and a function that tells their types,
 -- return a list showing where each argument is passed
 assignArgumentsPos conv arg_ty reps = assignments
index 1e3f17b..bb2d799 100644 (file)
@@ -355,7 +355,7 @@ copyOutOflow conv transfer area@(CallArea a) actuals updfr_off
                   else ([], 0)
                 Old -> ([], updfr_off)
 
                   else ([], 0)
                 Old -> ([], updfr_off)
 
-    args :: [(CmmExpr, ParamLocation ByteOff)]   -- The argument and where to put it
+    args :: [(CmmExpr, ParamLocation)]   -- The argument and where to put it
     args = assignArgumentsPos conv cmmExprType actuals
 
     args' = foldl adjust setRA args
     args = assignArgumentsPos conv cmmExprType actuals
 
     args' = foldl adjust setRA args
index 0800bfb..4d5fdf2 100644 (file)
@@ -1,7 +1,6 @@
 More notes (June 11)\r
 ~~~~~~~~~~~~~~~~~~~~\r
 More notes (June 11)\r
 ~~~~~~~~~~~~~~~~~~~~\r
-* Bake in ByteOff to ParamLocation and ArgumentFormat\r
-  CmmActuals -> [CmmActual]  similary CmmFormals\r
+* CmmActuals -> [CmmActual]  similary CmmFormals\r
 \r
 * Possible refactoring: Nuke AGraph in favour of \r
       mkIfThenElse :: Expr -> Graph -> Graph -> FCode Graph\r
 \r
 * Possible refactoring: Nuke AGraph in favour of \r
       mkIfThenElse :: Expr -> Graph -> Graph -> FCode Graph\r