module CmmCallConv (
ParamLocation(..),
ArgumentFormat,
- assignArguments,
- assignArgumentsPos,
- argumentsSize,
+ assignArgumentsPos
) where
#include "HsVersions.h"
type ArgumentFormat a b = [(a, ParamLocation b)]
-assignArguments :: (a -> CmmType) -> [a] -> ArgumentFormat a WordOff
--- Stack parameters are returned as word offsets.
-assignArguments _ _ = panic "assignArguments only used in dead codegen" -- assignments
-
-- | 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.
where w = typeWidth (arg_ty r)
size = (((widthInBytes w - 1) `div` wORD_SIZE) + 1) * wORD_SIZE
off' = offset + size
-
-
-argumentsSize :: (a -> CmmType) -> [a] -> WordOff
-argumentsSize f reps = maximum (0 : map arg_top args)
- where
- args = assignArguments f reps
- arg_top (_, StackParam offset) = -offset
- arg_top (_, RegisterParam _) = 0
-----------------------------------------------------------------------------
-- Local information about the registers available
More notes (June 11)\r
~~~~~~~~~~~~~~~~~~~~\r
-* Kill dead code assignArguments, argumentsSize in CmmCallConv.\r
- Bake in ByteOff to ParamLocation and ArgumentFormat\r
+* Bake in ByteOff to ParamLocation and ArgumentFormat\r
CmmActuals -> [CmmActual] similary CmmFormals\r
\r
* Possible refactoring: Nuke AGraph in favour of \r