[project @ 2005-05-17 09:40:51 by simonmar]
[ghc-hetmet.git] / ghc / compiler / cmm / PprC.hs
index adfafaf..1cb5366 100644 (file)
@@ -366,8 +366,8 @@ pprLit :: CmmLit -> SDoc
 pprLit lit = case lit of
     CmmInt i rep      -> pprHexVal i rep
     CmmFloat f rep     -> parens (machRepCType rep) <> (rational f)
-    CmmLabel clbl      -> mkW_ <> pprCLabel clbl
-    CmmLabelOff clbl i -> mkW_ <> pprCLabel clbl <> char '+' <> int i
+    CmmLabel clbl      -> mkW_ <> pprCLabelAddr clbl
+    CmmLabelOff clbl i -> mkW_ <> pprCLabelAddr clbl <> char '+' <> int i
     CmmLabelDiffOff clbl1 clbl2 i
         -- WARNING:
         --  * the lit must occur in the info table clbl2
@@ -375,7 +375,9 @@ pprLit lit = case lit of
         -- The Mangler is expected to convert any reference to an SRT,
         -- a slow entry point or a large bitmap
         -- from an info table to an offset.
-        -> mkW_ <> pprCLabel clbl1 <> char '+' <> int i
+        -> mkW_ <> pprCLabelAddr clbl1 <> char '+' <> int i
+
+pprCLabelAddr lbl = char '&' <> pprCLabel lbl
 
 pprLit1 :: CmmLit -> SDoc
 pprLit1 lit@(CmmLabelOff _ _) = parens (pprLit lit)
@@ -640,6 +642,7 @@ isStrangeTypeReg (CmmGlobal g)      = isStrangeTypeGlobal g
 isStrangeTypeGlobal :: GlobalReg -> Bool
 isStrangeTypeGlobal CurrentTSO         = True
 isStrangeTypeGlobal CurrentNursery     = True
+isStrangeTypeGlobal BaseReg            = True
 isStrangeTypeGlobal r                  = isPtrGlobalReg r
 
 strangeRegType :: CmmReg -> Maybe SDoc
@@ -698,7 +701,7 @@ pprCall ppr_fn cconv results args vols
   where 
      ppr_results []     = empty
      ppr_results [(one,hint)] 
-        = pprExpr (CmmReg one) <> ptext SLIT(" = ")
+        = pprReg one <> ptext SLIT(" = ")
                 <> pprUnHint hint (cmmRegRep one)
      ppr_results _other = panic "pprCall: multiple results"