[project @ 2005-11-02 11:56:56 by simonmar]
[ghc-hetmet.git] / ghc / compiler / cmm / PprC.hs
index 9c494fe..7427f50 100644 (file)
@@ -69,8 +69,7 @@ pprCs dflags cmms
 
 writeCs :: DynFlags -> Handle -> [Cmm] -> IO ()
 writeCs dflags handle cmms 
-  = printForUser handle alwaysQualify (pprCs dflags cmms)
-       -- ToDo: should be printForC
+  = printForC handle (pprCs dflags cmms)
 
 -- --------------------------------------------------------------------------
 -- Now do some real work
@@ -655,6 +654,7 @@ isStrangeTypeGlobal r                       = isPtrGlobalReg r
 strangeRegType :: CmmReg -> Maybe SDoc
 strangeRegType (CmmGlobal CurrentTSO) = Just (ptext SLIT("struct StgTSO_ *"))
 strangeRegType (CmmGlobal CurrentNursery) = Just (ptext SLIT("struct bdescr_ *"))
+strangeRegType (CmmGlobal BaseReg) = Just (ptext SLIT("struct StgRegTable_ *"))
 strangeRegType _ = Nothing
 
 -- pprReg just prints the register name.
@@ -708,6 +708,9 @@ pprCall ppr_fn cconv results args vols
   where 
      ppr_results []     = empty
      ppr_results [(one,hint)] 
+        | Just ty <- strangeRegType one
+        = pprReg one <> ptext SLIT(" = ") <> parens ty
+        | otherwise
         = pprReg one <> ptext SLIT(" = ")
                 <> pprUnHint hint (cmmRegRep one)
      ppr_results _other = panic "pprCall: multiple results"