diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2011-06-13 17:29:58 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@mit.edu> | 2011-06-13 17:29:58 +0100 |
commit | f3a1b28e408de01d01ec252efd5b54722eb775d8 (patch) | |
tree | 57a9b37fb0c7b5fbcdadd7fab9ba63c7fc84e75e /compiler | |
parent | 8b3bfb2ec41fd0e807a8f6e7a823795eafca1dcb (diff) | |
download | haskell-f3a1b28e408de01d01ec252efd5b54722eb775d8.tar.gz |
Bake in ByteOff to ParamLocation, and remove ArgumentFormat synonym.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cmm/CmmCallConv.hs | 13 | ||||
-rw-r--r-- | compiler/cmm/MkGraph.hs | 2 | ||||
-rw-r--r-- | compiler/cmm/cmm-notes | 3 |
3 files changed, 7 insertions, 11 deletions
diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs index 73ce529566..c81b868167 100644 --- a/compiler/cmm/CmmCallConv.hs +++ b/compiler/cmm/CmmCallConv.hs @@ -1,6 +1,5 @@ module CmmCallConv ( ParamLocation(..), - ArgumentFormat, 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. -data ParamLocation a +data ParamLocation = 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 -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. -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 diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs index 1e3f17b5a8..bb2d799487 100644 --- a/compiler/cmm/MkGraph.hs +++ b/compiler/cmm/MkGraph.hs @@ -355,7 +355,7 @@ copyOutOflow conv transfer area@(CallArea a) actuals 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 diff --git a/compiler/cmm/cmm-notes b/compiler/cmm/cmm-notes index 0800bfb66f..4d5fdf22e1 100644 --- a/compiler/cmm/cmm-notes +++ b/compiler/cmm/cmm-notes @@ -1,7 +1,6 @@ More notes (June 11)
~~~~~~~~~~~~~~~~~~~~
-* Bake in ByteOff to ParamLocation and ArgumentFormat
- CmmActuals -> [CmmActual] similary CmmFormals
+* CmmActuals -> [CmmActual] similary CmmFormals
* Possible refactoring: Nuke AGraph in favour of
mkIfThenElse :: Expr -> Graph -> Graph -> FCode Graph
|