[project @ 2005-11-02 11:56:56 by simonmar]
authorsimonmar <unknown>
Wed, 2 Nov 2005 11:56:56 +0000 (11:56 +0000)
committersimonmar <unknown>
Wed, 2 Nov 2005 11:56:56 +0000 (11:56 +0000)
Fix warnings when assigning the result of a foreign call to BaseReg
(as now happens in SMP mode with resumeThread()).

ghc/compiler/cmm/PprC.hs

index 8bcfd0c..7427f50 100644 (file)
@@ -654,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.
@@ -707,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"