X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FTcIface.lhs;h=6f76ae116ea23197e32ec271857abf6e635f9fc8;hb=b1ab4b8a607addc4d097588db5761313c996a41f;hp=8bbb79a63b17cc60158b3972ff42a179342c0cae;hpb=d33c0b24a0306cc57161b7ed7ff2510d0b017b11;p=ghc-hetmet.git diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 8bbb79a..6f76ae1 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -8,8 +8,8 @@ Type checking of type signatures in interface files \begin{code} module TcIface ( tcImportDecl, checkWiredInTyCon, tcHiBootIface, typecheckIface, - tcIfaceDecl, tcIfaceInst, tcIfaceFamInst, tcIfaceRules, tcIfaceGlobal, - tcExtCoreBindings + tcIfaceDecl, tcIfaceInst, tcIfaceFamInst, tcIfaceRules, + tcIfaceVectInfo, tcIfaceGlobal, tcExtCoreBindings ) where #include "HsVersions.h" @@ -38,6 +38,7 @@ import DataCon import TysWiredIn import Var ( TyVar ) import qualified Var +import VarEnv import Name import NameEnv import OccName @@ -198,6 +199,10 @@ typecheckIface iface ; fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface) ; rules <- tcIfaceRules ignore_prags (mi_rules iface) + -- Vectorisation information + ; vect_info <- tcIfaceVectInfo (mi_module iface) type_env + (mi_vect_info iface) + -- Exports ; exports <- ifaceExportNames (mi_exports iface) @@ -208,6 +213,7 @@ typecheckIface iface , md_insts = insts , md_fam_insts = fam_insts , md_rules = rules + , md_vect_info = vect_info , md_exports = exports , md_modBreaks = emptyModBreaks } @@ -383,7 +389,9 @@ tcIfaceDecl ignore_prags ; rhs_tyki <- tcIfaceType rdr_rhs_ty ; let rhs = if isOpen then OpenSynTyCon rhs_tyki Nothing else SynonymTyCon rhs_tyki - ; return (ATyCon (buildSynTyCon tc_name tyvars rhs)) + -- !!!TODO: read mb_family info from iface and pass as last argument + ; tycon <- buildSynTyCon tc_name tyvars rhs Nothing + ; return $ ATyCon tycon } tcIfaceDecl ignore_prags @@ -570,6 +578,34 @@ tcIfaceRule (IfaceRule {ifRuleName = name, ifActivation = act, ifRuleBndrs = bnd %************************************************************************ %* * + Vectorisation information +%* * +%************************************************************************ + +\begin{code} +tcIfaceVectInfo :: Module -> TypeEnv -> IfaceVectInfo -> IfL VectInfo +tcIfaceVectInfo mod typeEnv (IfaceVectInfo names) + = do { ccVars <- mapM ccMapping names + ; return $ VectInfo (mkVarEnv ccVars) + } + where + ccMapping name + = do { ccName <- lookupOrig mod (mkCloOcc (nameOccName name)) + ; let { var = lookup name + ; ccVar = lookup ccName + } + ; return (var, (var, ccVar)) + } + lookup name = case lookupTypeEnv typeEnv name of + Just (AnId var) -> var + Just _ -> + panic "TcIface.tcIfaceVectInfo: wrong TyThing" + Nothing -> + panic "TcIface.tcIfaceVectInfo: unknown name" +\end{code} + +%************************************************************************ +%* * Types %* * %************************************************************************