[project @ 1997-05-19 00:07:38 by sof]
[ghc-hetmet.git] / ghc / compiler / codeGen / CgLetNoEscape.lhs
index f59ef4e..591e775 100644 (file)
 
 module CgLetNoEscape ( cgLetNoEscapeClosure ) where
 
-import Ubiq{-uitious-}
-import CgLoop2         ( cgExpr )
+IMP_Ubiq(){-uitious-}
+IMPORT_DELOOPER(CgLoop2)               ( cgExpr )
 
 import StgSyn
 import CgMonad
 import AbsCSyn
 
 import CgBindery       ( letNoEscapeIdInfo, bindArgsToRegs,
-                         bindNewToAStack, bindNewToBStack
+                         bindNewToAStack, bindNewToBStack,
+                         CgIdInfo
                        )
 import CgHeapery       ( heapCheck )
 import CgRetConv       ( assignRegs )
@@ -28,7 +29,7 @@ import CgStackery     ( mkVirtStkOffsets )
 import CgUsages                ( setRealAndVirtualSps, getVirtSps )
 import CLabel          ( mkStdEntryLabel )
 import ClosureInfo     ( mkLFLetNoEscape )
-import HeapOffs                ( VirtualSpBOffset(..) )
+import HeapOffs                ( SYN_IE(VirtualSpBOffset) )
 import Id              ( idPrimRep )
 \end{code}
 
@@ -169,9 +170,9 @@ cgLetNoEscapeBody :: [Id]           -- Args
 cgLetNoEscapeBody all_args rhs
   = getVirtSps         `thenFC` \ (vA, vB) ->
     let
-       arg_kinds       = map idPrimRep all_args
-       (arg_regs, _)   = assignRegs [{-nothing live-}] arg_kinds
-       stk_args        = drop (length arg_regs) all_args
+       arg_kinds            = map idPrimRep all_args
+       (arg_regs, _)        = assignRegs [{-nothing live-}] arg_kinds
+       (reg_args, stk_args) = splitAt (length arg_regs) all_args
 
        -- stk_args is the args which are passed on the stack at the fast-entry point
        -- Using them, we define the stack layout
@@ -183,7 +184,7 @@ cgLetNoEscapeBody all_args rhs
     in
 
        -- Bind args to appropriate regs/stk locns
-    bindArgsToRegs all_args arg_regs               `thenC`
+    bindArgsToRegs reg_args arg_regs               `thenC`
     mapCs bindNewToAStack stk_bxd_w_offsets        `thenC`
     mapCs bindNewToBStack stk_ubxd_w_offsets       `thenC`
     setRealAndVirtualSps spA_stk_args spB_stk_args  `thenC`