X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcRnTypes.lhs;h=3f347913b8d81764f4a9dea50b946aca6913fd88;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=14eae9b891305c9dc3de5203e3587875864f0b46;hpb=550421384b8364cdaf3135f7859c9f7d7ee1fff1;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcRnTypes.lhs b/ghc/compiler/typecheck/TcRnTypes.lhs index 14eae9b..3f34791 100644 --- a/ghc/compiler/typecheck/TcRnTypes.lhs +++ b/ghc/compiler/typecheck/TcRnTypes.lhs @@ -156,14 +156,21 @@ data TcGblEnv -- rather like the free variables of the program, but -- are implicit instead of explicit. + tcg_th_used :: TcRef Bool, -- True <=> Template Haskell syntax used + -- We need this so that we can generate a dependency on the + -- Template Haskell package, becuase the desugarer is going to + -- emit loads of references to TH symbols. It's rather like + -- tcg_inst_uses; the reference is implicit rather than explicit, + -- so we have to zap a mutable variable. + -- Now a bunch of things about this module that are simply -- accumulated, but never consulted until the end. -- Nevertheless, it's convenient to accumulate them along -- with the rest of the info from this module. - tcg_exports :: Avails, -- What is exported - tcg_imports :: ImportAvails, -- Information about what was imported - -- from where, including things bound - -- in this module + tcg_exports :: NameSet, -- What is exported + tcg_imports :: ImportAvails, -- Information about what was imported + -- from where, including things bound + -- in this module tcg_dus :: DefUses, -- What is defined in this module and what is used. -- The latter is used to generate @@ -353,15 +360,14 @@ data TcTyThing = AGlobal TyThing -- Used only in the return type of a lookup | ATcId TcId ThLevel ProcLevel -- Ids defined in this module; may not be fully zonked | ATyVar TyVar -- Type variables - | ARecTyCon TcKind -- Used temporarily, during kind checking, for the - | ARecClass TcKind -- tycons and clases in this recursive group + | AThing TcKind -- Used temporarily, during kind checking, for the + -- tycons and clases in this recursive group instance Outputable TcTyThing where -- Debugging only ppr (AGlobal g) = text "AGlobal" <+> ppr g ppr (ATcId g tl pl) = text "ATcId" <+> ppr g <+> ppr tl <+> ppr pl ppr (ATyVar t) = text "ATyVar" <+> ppr t - ppr (ARecTyCon k) = text "ARecTyCon" <+> ppr k - ppr (ARecClass k) = text "ARecClass" <+> ppr k + ppr (AThing k) = text "AThing" <+> ppr k \end{code} \begin{code} @@ -437,7 +443,7 @@ data ImportAvails -- combine stuff coming from different (unqualified) -- imports of the same module - imp_mods :: ModuleEnv (Module, Maybe Bool), + imp_mods :: ModuleEnv (Module, Maybe Bool, SrcSpan), -- Domain is all directly-imported modules -- Maybe value answers the question "is the import restricted?" -- Nothing => unrestricted import (e.g., "import Foo")