import PprCmm ( pprStmt, pprCmms )
import MachOp
import CLabel
-#if powerpc_TARGET_ARCH
-import CLabel ( mkRtsCodeLabel )
-#endif
import UniqFM
import Unique ( Unique, getUnique )
import UniqSupply
import FastTypes
import List ( groupBy, sortBy )
-import CLabel ( pprCLabel )
import ErrUtils ( dumpIfSet_dyn )
import DynFlags
import StaticFlags ( opt_Static, opt_PIC )
mapping = foldr plusUFM emptyUFM mappings
build_mapping top@(CmmData _ _) = (top, emptyUFM)
-build_mapping (CmmProc info lbl params []) $
+build_mapping (CmmProc info lbl params [])
= (CmmProc info lbl params [], emptyUFM)
build_mapping (CmmProc info lbl params (head:blocks))
= (CmmProc info lbl params (head:others), mapping)
where
reg_or_addr = get_GlobalReg_reg_or_addr reg
-fixAssign (CmmCall target results args vols)
+{-
+fixAssign (CmmCall target results args)
= mapAndUnzipUs fixResult results `thenUs` \ (results',stores) ->
- returnUs (caller_save ++
- CmmCall target results' args vols :
- caller_restore ++
+ returnUs (CmmCall target results' args :
concat stores)
where
- -- we also save/restore any caller-saves STG registers here
- (caller_save, caller_restore) = callerSaveVolatileRegs vols
-
fixResult g@(CmmGlobal reg,hint) =
case get_GlobalReg_reg_or_addr reg of
Left realreg -> returnUs (g, [])
[CmmStore baseRegAddr (CmmReg local)])
fixResult other =
returnUs (other,[])
+-}
fixAssign other_stmt = returnUs [other_stmt]
-> do addr' <- cmmExprConFold JumpReference addr
return $ CmmJump addr' regs
- CmmCall target regs args vols
+ CmmCall target regs args srt
-> do target' <- case target of
CmmForeignCall e conv -> do
e' <- cmmExprConFold CallReference e
args' <- mapM (\(arg, hint) -> do
arg' <- cmmExprConFold DataReference arg
return (arg', hint)) args
- return $ CmmCall target' regs args' vols
+ return $ CmmCall target' regs args' srt
CmmCondBranch test dest
-> do test' <- cmmExprConFold DataReference test