X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FMkIface.lhs;h=fa91a0ac190d37c4c13416e00753600cfce1417c;hb=0b86bc9b022a5965d2b35f143ff4b919f784e676;hp=5dbf4e7e44c9ce9d7da567af84385d0ae9647817;hpb=fdcf1ffec106b17928d0dfabad4ee7c851500cd2;p=ghc-hetmet.git diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 5dbf4e7..fa91a0a 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -11,8 +11,10 @@ module MkIface ( writeIfaceFile, -- Write the interface file - checkOldIface -- See if recompilation is required, by + checkOldIface, -- See if recompilation is required, by -- comparing version information + + tyThingToIfaceDecl -- Converting things to their Iface equivalents ) where \end{code} @@ -186,7 +188,7 @@ import Class ( classExtraBigSig, classTyCon ) import TyCon ( TyCon, AlgTyConRhs(..), isRecursiveTyCon, isForeignTyCon, isSynTyCon, isAlgTyCon, isPrimTyCon, isFunTyCon, isTupleTyCon, tupleTyConBoxity, tyConStupidTheta, - tyConHasGenerics, tyConArgVrcs, synTyConRhs, isGadtSyntaxTyCon, + tyConHasGenerics, synTyConRhs, isGadtSyntaxTyCon, tyConArity, tyConTyVars, algTyConRhs, tyConExtName ) import DataCon ( dataConName, dataConFieldLabels, dataConStrictMarks, dataConTyCon, dataConIsInfix, dataConUnivTyVars, dataConExTyVars, dataConEqSpec, @@ -197,6 +199,7 @@ import TysPrim ( alphaTyVars ) import InstEnv ( Instance(..) ) import TcRnMonad import HscTypes ( ModIface(..), ModDetails(..), + ModGuts(..), HscEnv(..), hscEPS, Dependencies(..), FixItem(..), ModSummary(..), msHiFilePath, mkIfaceDepCache, mkIfaceFixCache, mkIfaceVerCache, typeEnvElts, @@ -208,7 +211,7 @@ import HscTypes ( ModIface(..), ModDetails(..), ) -import DynFlags ( GhcMode(..), DynFlag(..), dopt ) +import DynFlags ( GhcMode(..), DynFlags(..), DynFlag(..), dopt ) import Name ( Name, nameModule, nameOccName, nameParent, isExternalName, isInternalName, nameParent_maybe, isWiredInName, isImplicitName, NamedThing(..) ) @@ -994,8 +997,7 @@ tyThingToIfaceDecl ext (AClass clas) ifTyVars = toIfaceTvBndrs clas_tyvars, ifFDs = map toIfaceFD clas_fds, ifSigs = map toIfaceClassOp op_stuff, - ifRec = boolToRecFlag (isRecursiveTyCon tycon), - ifVrcs = tyConArgVrcs tycon } + ifRec = boolToRecFlag (isRecursiveTyCon tycon) } where (clas_tyvars, clas_fds, sc_theta, _, op_stuff) = classExtraBigSig clas tycon = classTyCon clas @@ -1012,13 +1014,12 @@ tyThingToIfaceDecl ext (AClass clas) (sel_tyvars, rho_ty) = splitForAllTys (idType sel_id) op_ty = funResultTy rho_ty - toIfaceFD (tvs1, tvs2) = (map getOccName tvs1, map getOccName tvs2) + toIfaceFD (tvs1, tvs2) = (map (occNameFS.getOccName) tvs1, map (occNameFS.getOccName) tvs2) tyThingToIfaceDecl ext (ATyCon tycon) | isSynTyCon tycon = IfaceSyn { ifName = getOccName tycon, ifTyVars = toIfaceTvBndrs tyvars, - ifVrcs = tyConArgVrcs tycon, ifSynRhs = toIfaceType ext syn_ty } | isAlgTyCon tycon @@ -1028,7 +1029,6 @@ tyThingToIfaceDecl ext (ATyCon tycon) ifCons = ifaceConDecls (algTyConRhs tycon), ifRec = boolToRecFlag (isRecursiveTyCon tycon), ifGadtSyntax = isGadtSyntaxTyCon tycon, - ifVrcs = tyConArgVrcs tycon, ifGeneric = tyConHasGenerics tycon } | isForeignTyCon tycon @@ -1043,8 +1043,7 @@ tyThingToIfaceDecl ext (ATyCon tycon) ifCons = IfAbstractTyCon, ifGadtSyntax = False, ifGeneric = False, - ifRec = NonRecursive, - ifVrcs = tyConArgVrcs tycon } + ifRec = NonRecursive} | otherwise = pprPanic "toIfaceDecl" (ppr tycon) where @@ -1179,7 +1178,7 @@ toIfaceExpr ext (Lit l) = IfaceLit l toIfaceExpr ext (Type ty) = IfaceType (toIfaceType ext ty) toIfaceExpr ext (Lam x b) = IfaceLam (toIfaceBndr ext x) (toIfaceExpr ext b) toIfaceExpr ext (App f a) = toIfaceApp ext f [a] -toIfaceExpr ext (Case s x ty as) = IfaceCase (toIfaceExpr ext s) (getOccName x) (toIfaceType ext ty) (map (toIfaceAlt ext) as) +toIfaceExpr ext (Case s x ty as) = IfaceCase (toIfaceExpr ext s) (occNameFS (getOccName x)) (toIfaceType ext ty) (map (toIfaceAlt ext) as) toIfaceExpr ext (Let b e) = IfaceLet (toIfaceBind ext b) (toIfaceExpr ext e) toIfaceExpr ext (Cast e co) = IfaceCast (toIfaceExpr ext e) (toIfaceType ext co) toIfaceExpr ext (Note n e) = IfaceNote (toIfaceNote ext n) (toIfaceExpr ext e) @@ -1194,7 +1193,7 @@ toIfaceBind ext (NonRec b r) = IfaceNonRec (toIfaceIdBndr ext b) (toIfaceExpr ex toIfaceBind ext (Rec prs) = IfaceRec [(toIfaceIdBndr ext b, toIfaceExpr ext r) | (b,r) <- prs] --------------------- -toIfaceAlt ext (c,bs,r) = (toIfaceCon c, map getOccName bs, toIfaceExpr ext r) +toIfaceAlt ext (c,bs,r) = (toIfaceCon c, map (occNameFS.getOccName) bs, toIfaceExpr ext r) --------------------- toIfaceCon (DataAlt dc) | isTupleTyCon tc = IfaceTupleAlt (tupleTyConBoxity tc) @@ -1230,7 +1229,7 @@ toIfaceVar ext v | Just fcall <- isFCallId_maybe v = IfaceFCall fcall (toIfaceType ext (idType v)) -- Foreign calls have special syntax | isExternalName name = IfaceExt (ext name) - | otherwise = IfaceLcl (nameOccName name) + | otherwise = IfaceLcl (occNameFS (nameOccName name)) where name = idName v \end{code}