Adding tick boxes to the interface syntax; fixes #1510
[ghc-hetmet.git] / compiler / iface / MkIface.lhs
index 4dd3c82..8213cb1 100644 (file)
@@ -339,8 +339,19 @@ mkIface hsc_env maybe_old_iface
      deliberatelyOmitted x = panic ("Deliberately omitted: " ++ x)
      ifFamInstTcName = ifaceTyConName . ifFamInstTyCon
 
-     flattenVectInfo (VectInfo ccVar) = 
-       IfaceVectInfo [Var.varName v | (v, _) <- varEnvElts ccVar]
+     flattenVectInfo (VectInfo { vectInfoCCVar   = ccVar
+                               , vectInfoCCTyCon = ccTyCon
+                               }) = 
+       IfaceVectInfo { 
+         ifaceVectInfoCCVar        = [ Var.varName v 
+                                     | (v, _) <- varEnvElts ccVar],
+         ifaceVectInfoCCTyCon      = [ tyConName t 
+                                     | (t, t_CC) <- nameEnvElts ccTyCon
+                                     , t /= t_CC],
+         ifaceVectInfoCCTyConReuse = [ tyConName t
+                                     | (t, t_CC) <- nameEnvElts ccTyCon
+                                     , t == t_CC]
+       } 
 
 -----------------------------
 writeIfaceFile :: DynFlags -> ModLocation -> ModIface -> IO ()
@@ -1348,6 +1359,8 @@ toIfaceVar v
   | Just fcall <- isFCallId_maybe v = IfaceFCall fcall (toIfaceType (idType v))
          -- Foreign calls have special syntax
   | isExternalName name                    = IfaceExt name
+  | Just (TickBox m ix) <- isTickBoxOp_maybe v
+                                   = IfaceTick m ix
   | otherwise                      = IfaceLcl (getFS name)
   where
     name = idName v