merge up to ghc HEAD 16-Apr-2011
[ghc-hetmet.git] / compiler / cmm / CmmNode.hs
index 12d534e..e67321c 100644 (file)
@@ -1,5 +1,12 @@
 -- CmmNode type for representation using Hoopl graphs.
 {-# LANGUAGE GADTs #-}
+
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
+#if __GLASGOW_HASKELL__ >= 701
+-- GHC 7.0.1 improved incomplete pattern warnings with GADTs
+{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
+#endif
+
 module CmmNode
   ( CmmNode(..)
   , UpdFrameOffset, Convention(..), ForeignConvention(..), ForeignTarget(..)
@@ -85,6 +92,8 @@ data CmmNode e x where
 A MidForeign call is used for *unsafe* foreign calls;
 a LastForeign call is used for *safe* foreign calls.
 Unsafe ones are easy: think of them as a "fat machine instruction".
+In particular, they do *not* kill all live registers (there was a bit
+of code in GHC that conservatively assumed otherwise.)
 
 Safe ones are trickier.  A safe foreign call 
      r = f(x)
@@ -129,14 +138,12 @@ instance Eq (CmmNode e x) where
 
 instance NonLocal CmmNode where
   entryLabel (CmmEntry l) = l
-  -- entryLabel _ = error "CmmNode.entryLabel"
 
   successors (CmmBranch l) = [l]
   successors (CmmCondBranch {cml_true=t, cml_false=f}) = [f, t] -- meets layout constraint
   successors (CmmSwitch _ ls) = catMaybes ls
   successors (CmmCall {cml_cont=l}) = maybeToList l
   successors (CmmForeignCall {succ=l}) = [l]
-  -- successors _ = error "CmmNode.successors"
 
 
 instance HooplNode CmmNode where