- (CmmReg $ CmmStack $ StackSlot area n) : ms)
-
-copyOut :: Convention -> StackArea -> CmmActuals -> [Middle]
-copyOut _ area actuals = moveSP : reverse (snd $ foldl co (1, []) actuals)
- where moveSP = MidAssign spReg $ CmmReg $ CmmStack $ outgoingSlot area
- co (n, ms) v = (n+1, MidAssign (CmmStack $ StackSlot area n)
- (kindlessCmm v) : ms)
-mkEntry :: BlockId -> Convention -> CmmFormalsWithoutKinds -> [Middle]
-mkEntry entryId conv formals = copyIn conv (mkStackArea entryId [] $ Just fs) fs
+ (CmmLoad (CmmStackSlot area n) wordRep) : ms)
+
+copyOut :: Convention -> Area -> CmmActuals -> [Middle]
+copyOut conv area actuals = moveSP conv $ snd $ foldl co (1, []) actuals
+ where moveSP (ConventionStandard _ Arguments) args =
+ MidAssign spReg (outgoingSlot area) : reverse args
+ moveSP _ args = reverse $ MidAssign spReg (outgoingSlot area) : args
+ co (n, ms) v = (n+1, MidStore (CmmStackSlot area n) (kindlessCmm v) : ms)
+mkEntry :: Area -> Convention -> CmmFormalsWithoutKinds -> [Middle]
+mkEntry area conv formals = copyIn conv area fs