Trim unused imports detected by new unused-import code
[ghc-hetmet.git] / compiler / cmm / ZipCfgCmmRep.hs
index 348ab5b..f99a7eb 100644 (file)
@@ -29,7 +29,6 @@ import CmmTx
 import CLabel
 import FastString
 import ForeignCall
-import qualified ZipCfg as Z
 import qualified ZipDataflow as DF
 import ZipCfg 
 import MkZipCfg
@@ -40,7 +39,6 @@ import Maybes
 import Monad
 import Outputable
 import Prelude hiding (zip, unzip, last)
-import qualified Data.List as L
 import SMRep (ByteOff)
 import UniqSupply
 
@@ -110,16 +108,22 @@ data MidCallTarget        -- The target of a MidUnsafeCall
   deriving Eq
 
 data Convention
-  = Native             -- Native C-- call/return
+  = NativeDirectCall -- Native C-- call skipping the node (closure) argument
+  
+  | NativeNodeCall   -- Native C-- call including the node argument
 
-  | Slow               -- Slow entry points: all args pushed on the stack
+  | NativeReturn     -- Native C-- return
 
-  | GC                         -- Entry to the garbage collector: uses the node reg!
+  | Slow             -- Slow entry points: all args pushed on the stack
 
-  | PrimOp             -- Calling prim ops
+  | GC               -- Entry to the garbage collector: uses the node reg!
 
-  | Foreign            -- Foreign call/return
-       ForeignConvention
+  | PrimOpCall       -- Calling prim ops
+
+  | PrimOpReturn     -- Returning from prim ops
+
+  | Foreign          -- Foreign call/return
+        ForeignConvention
 
   | Private
         -- Used for control transfers within a (pre-CPS) procedure All
@@ -456,7 +460,8 @@ pprMiddle stmt = pp_stmt <+> pp_debug
              MidForeignCall {} -> text "MidForeignCall"
 
 ppr_fc :: ForeignConvention -> SDoc
-ppr_fc (ForeignConvention c _ _) = doubleQuotes (ppr c)
+ppr_fc (ForeignConvention c args res) =
+  doubleQuotes (ppr c) <+> text "args: " <+> ppr args <+> text " results: " <+> ppr res
 
 ppr_safety :: ForeignSafety -> SDoc
 ppr_safety (Safe bid upd) = text "safe<" <> ppr bid <> text ", " <> ppr upd <> text ">"
@@ -515,12 +520,15 @@ genFullCondBranch expr t f =
          ]
 
 pprConvention :: Convention -> SDoc
-pprConvention (Native {})  = text "<native-convention>"
-pprConvention  Slow        = text "<slow-convention>"
-pprConvention  GC          = text "<gc-convention>"
-pprConvention  PrimOp      = text "<primop-convention>"
-pprConvention (Foreign c)  = ppr c
-pprConvention (Private {}) = text "<private-convention>"
+pprConvention (NativeNodeCall   {}) = text "<native-node-call-convention>"
+pprConvention (NativeDirectCall {}) = text "<native-direct-call-convention>"
+pprConvention (NativeReturn {})     = text "<native-ret-convention>"
+pprConvention  Slow                 = text "<slow-convention>"
+pprConvention  GC                   = text "<gc-convention>"
+pprConvention  PrimOpCall           = text "<primop-call-convention>"
+pprConvention  PrimOpReturn         = text "<primop-ret-convention>"
+pprConvention (Foreign c)           = ppr c
+pprConvention (Private {})          = text "<private-convention>"
 
 pprForeignConvention :: ForeignConvention -> SDoc
 pprForeignConvention (ForeignConvention c as rs) = ppr c <> ppr as <> ppr rs