X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FPprC.hs;h=77d337df9363772f7ea7e3ce9ceffcdc3127b3cb;hb=48fb2b521898998a17873ad6cf30610aa5ab6db3;hp=8726547ae9f8194da6e3c2d8c4b45009a96fbdab;hpb=f96e9aa0444de0e673b3c4055c6e43299639bc5b;p=ghc-hetmet.git diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs index 8726547..77d337d 100644 --- a/compiler/cmm/PprC.hs +++ b/compiler/cmm/PprC.hs @@ -199,11 +199,11 @@ pprStmt stmt = case stmt of where rep = cmmExprRep src - CmmCall (CmmForeignCall fn cconv) results args srt -> + CmmCall (CmmForeignCall fn cconv) results args safety -> -- Controversial: leave this out for now. -- pprUndef fn $$ - pprCall ppr_fn cconv results args srt + pprCall ppr_fn cconv results args safety where ppr_fn = case fn of CmmLit (CmmLabel lbl) -> pprCLabel lbl @@ -220,8 +220,8 @@ pprStmt stmt = case stmt of ptext SLIT("#undef") <+> pprCLabel lbl pprUndef _ = empty - CmmCall (CmmPrim op) results args srt -> - pprCall ppr_fn CCallConv results args srt + CmmCall (CmmPrim op) results args safety -> + pprCall ppr_fn CCallConv results args safety where ppr_fn = pprCallishMachOp_for_C op @@ -632,12 +632,12 @@ pprAssign r1 (CmmRegOff r2 off) -- We can't cast the lvalue, so we have to cast the rhs if necessary. Casting -- the lvalue elicits a warning from new GCC versions (3.4+). pprAssign r1 r2 - | isFixedPtrReg r1 - = pprReg r1 <> ptext SLIT(" = ") <> mkP_ <> pprExpr1 r2 <> semi - | Just ty <- strangeRegType r1 - = pprReg r1 <> ptext SLIT(" = ") <> parens ty <> pprExpr1 r2 <> semi - | otherwise - = pprReg r1 <> ptext SLIT(" = ") <> pprExpr r2 <> semi + | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) + | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) + | otherwise = mkAssign (pprExpr r2) + where mkAssign x = if r1 == CmmGlobal BaseReg + then ptext SLIT("ASSIGN_BaseReg") <> parens x <> semi + else pprReg r1 <> ptext SLIT(" = ") <> x <> semi -- --------------------------------------------------------------------- -- Registers @@ -719,7 +719,7 @@ pprLocalReg (LocalReg uniq _ _) = char '_' <> ppr uniq -- ----------------------------------------------------------------------------- -- Foreign Calls -pprCall :: SDoc -> CCallConv -> CmmHintFormals -> CmmActuals -> C_SRT +pprCall :: SDoc -> CCallConv -> CmmHintFormals -> CmmActuals -> CmmSafety -> SDoc pprCall ppr_fn cconv results args _