[project @ 2000-03-27 16:22:09 by simonpj]
authorsimonpj <unknown>
Mon, 27 Mar 2000 16:22:11 +0000 (16:22 +0000)
committersimonpj <unknown>
Mon, 27 Mar 2000 16:22:11 +0000 (16:22 +0000)
Fix a bug in import listing in interface files that meant we lost track of
interface files.  This fixes the problem that led Sven to add lots of
import PprType() decls.  I've removed them all again!

19 files changed:
ghc/compiler/codeGen/CgCase.lhs
ghc/compiler/codeGen/CgExpr.lhs
ghc/compiler/coreSyn/CoreLint.lhs
ghc/compiler/deSugar/DsCCall.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/hsSyn/HsCore.lhs
ghc/compiler/rename/RnIfaces.lhs
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/specialise/Specialise.lhs
ghc/compiler/stgSyn/StgLint.lhs
ghc/compiler/stgSyn/StgSyn.lhs
ghc/compiler/typecheck/TcBinds.lhs
ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcDeriv.lhs
ghc/compiler/typecheck/TcForeign.lhs
ghc/compiler/typecheck/TcMonad.lhs
ghc/compiler/typecheck/TcPat.lhs
ghc/compiler/types/Unify.lhs

index 8bf74fa..0bc6508 100644 (file)
@@ -1,7 +1,7 @@
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
-% $Id: CgCase.lhs,v 1.39 2000/03/25 12:38:40 panne Exp $
+% $Id: CgCase.lhs,v 1.40 2000/03/27 16:22:09 simonpj Exp $
 %
 %********************************************************
 %*                                                     *
@@ -62,7 +62,6 @@ import TyCon          ( TyCon, isEnumerationTyCon, isUnboxedTupleTyCon,
                          tyConDataCons, tyConFamilySize )
 import Type            ( Type, typePrimRep, splitAlgTyConApp, 
                          splitTyConApp_maybe, repType )
-import PprType          ( {- instance Outputable Type -} )
 import Unique           ( Unique, Uniquable(..), mkPseudoUnique1 )
 import Maybes          ( maybeToBool )
 import Util
index 9c8dfd3..d30731f 100644 (file)
@@ -1,7 +1,7 @@
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
-% $Id: CgExpr.lhs,v 1.32 2000/03/25 12:38:40 panne Exp $
+% $Id: CgExpr.lhs,v 1.33 2000/03/27 16:22:09 simonpj Exp $
 %
 %********************************************************
 %*                                                     *
@@ -48,7 +48,6 @@ import PrimRep                ( getPrimRepSize, PrimRep(..), isFollowableRep )
 import TyCon           ( maybeTyConSingleCon,
                          isUnboxedTupleTyCon, isEnumerationTyCon )
 import Type            ( Type, typePrimRep, splitTyConApp_maybe, repType )
-import PprType          ( {- instance Outputable Type -} )
 import Maybes          ( assocMaybe, maybeToBool )
 import Unique          ( mkBuiltinUnique )
 import BasicTypes      ( TopLevelFlag(..), RecFlag(..) )
index 002d829..02d6e87 100644 (file)
@@ -40,7 +40,6 @@ import Type           ( Type, Kind, tyVarsOfType,
                          isUnboxedTupleType,
                          hasMoreBoxityInfo
                        )
-import PprType          ( {- instance Outputable Type -} )
 import TyCon           ( TyCon, isPrimTyCon, tyConDataCons )
 import BasicTypes      ( RecFlag(..), isNonRec )
 import Outputable
index 7752c42..35722fa 100644 (file)
@@ -33,7 +33,6 @@ import CallConv
 import Type            ( isUnLiftedType, splitAlgTyConApp_maybe, mkFunTys,
                          splitTyConApp_maybe, tyVarsOfType, mkForAllTys, Type
                        )
-import PprType          ( {- instance Outputable Type -} )
 import TysPrim         ( byteArrayPrimTy, realWorldStatePrimTy,
                          byteArrayPrimTyCon, mutableByteArrayPrimTyCon )
 import TysWiredIn      ( unitDataConId, stringTy,
index 5e78e8e..c812165 100644 (file)
@@ -43,7 +43,6 @@ import Type           ( splitFunTys, mkTyConApp,
                          isNotUsgTy, unUsgTy,
                          splitAppTy, isUnLiftedType, Type
                        )
-import PprType          ( {- instance Outputable Type -} )
 import TysWiredIn      ( tupleCon, unboxedTupleCon,
                          listTyCon, mkListTy,
                          charDataCon, charTy, stringTy,
index 4f03dbc..8e4d0b7 100644 (file)
@@ -36,7 +36,6 @@ import Type           ( splitAlgTyConApp_maybe,  unUsgTy,
                          Type, mkFunTys, mkForAllTys, mkTyConApp,
                          mkTyVarTy, mkFunTy, splitAppTy
                        )
-import PprType          ( {- instance Outputable Type -} )
 import PrimOp          ( PrimOp(..), CCall(..), CCallTarget(..) )
 import Var             ( TyVar )
 import TysPrim         ( realWorldStatePrimTy, addrPrimTy )
index f682752..1837027 100644 (file)
@@ -30,7 +30,6 @@ import Demand         ( Demand )
 import Literal         ( Literal )
 import PrimOp          ( CCall, pprCCallOp )
 import Type            ( Kind )
-import PprType         ( {- instance Outputable Kind -} )
 import CostCentre
 import SrcLoc          ( SrcLoc )
 import Outputable
index d15cd25..ff3f51c 100644 (file)
@@ -196,12 +196,10 @@ addModDeps mod mod_deps new_deps
        --      either are dependent via a non-library module
        --      or contain orphan rules or instance decls
 
-       -- Don't ditch a module that's already loaded
-       -- If it isn't loaded, and together the is_boot-ness
-    combine old@(_, _, _, Just _)  new = old
-    combine old@(_, _, old_is_boot, Nothing) 
-            new@(version, has_orphans, new_is_boot, _) 
-               = (version, has_orphans, old_is_boot && new_is_boot, Nothing)
+    combine old@(_, _, old_is_boot, cts) new
+       | maybeToBool cts || not old_is_boot = old      -- Keep the old info if it's already loaded
+                                                       -- or if it's a non-boot pending load
+       | otherwise                          = new      -- Otherwise pick new info
 
 loadExport :: ModuleName -> ExportItem -> RnM d [AvailInfo]
 loadExport this_mod (mod, entities)
@@ -761,6 +759,13 @@ getImportVersions this_mod (ExportEnv _ _ export_all_mods)
        -- I can't be bothered just now.
 
        mk_version_info mod_name (version, has_orphans, is_boot, contents) so_far
+          | mod_name == this_mod       -- Check if M appears in the set of modules 'below' M
+                                       -- This seems like a convenient place to check
+          = WARN( not is_boot, ptext SLIT("Wierd:") <+> ppr this_mod <+> 
+                               ptext SLIT("imports itself (perhaps indirectly)") )
+            so_far
+          | otherwise
           = let
                go_for_it exports = (mod_name, version, has_orphans, is_boot, exports) 
                                     : so_far
@@ -794,10 +799,6 @@ getImportVersions this_mod (ExportEnv _ _ export_all_mods)
                     is_lib_module     = isLibModule mod
             
     in
-       -- A module shouldn't load its own interface
-       -- This seems like a convenient place to check
-    WARN( maybeToBool (lookupFM mod_map this_mod), 
-         ptext SLIT("Wierd:") <+> ppr this_mod <+> ptext SLIT("loads its own interface") )
 
     returnRn (foldFM mk_version_info [] mod_map)
   where
index 58062d2..22d1357 100644 (file)
@@ -36,7 +36,6 @@ import SimplMonad
 import Type            ( Type, tyVarsOfType, tyVarsOfTypes, mkForAllTys, seqType,
                          splitTyConApp_maybe, splitAlgTyConApp_maybe, mkTyVarTys, applyTys, splitFunTys, mkFunTys
                        )
-import PprType          ( {- instance Outputable Type -} )
 import DataCon         ( dataConRepArity )
 import TysPrim         ( statePrimTyCon )
 import Var             ( setVarUnique )
index 81799e5..3154df7 100644 (file)
@@ -21,7 +21,6 @@ import Type           ( Type, mkTyVarTy, splitSigmaTy, splitFunTysN,
                          tyVarsOfType, tyVarsOfTypes, tyVarsOfTheta, applyTys,
                          mkForAllTys, boxedTypeKind
                        )
-import PprType          ( {- instance Outputable Type -} )
 import Subst           ( Subst, mkSubst, substTy, emptySubst, substBndrs, extendSubstList,
                          substId, substAndCloneId, substAndCloneIds, lookupIdSubst
                        ) 
index c7c126d..c0300a5 100644 (file)
@@ -22,7 +22,6 @@ import ErrUtils               ( ErrMsg, Message, addErrLocHdrLine, pprBagOfErrors, dontAddErr
 import Type            ( mkFunTys, splitFunTys, splitAlgTyConApp_maybe, 
                          isUnLiftedType, isTyVarTy, splitForAllTys, Type
                        )
-import PprType          ( {- instance Outputable Type -} )
 import TyCon           ( TyCon, isDataTyCon )
 import Util            ( zipEqual )
 import Outputable
index 429d24f..759c174 100644 (file)
@@ -53,7 +53,6 @@ import PrimOp         ( PrimOp )
 import PrimRep         ( PrimRep(..) )
 import Outputable
 import Type             ( Type )
-import PprType          ( {- instance Outputable Type -} )
 import UniqSet         ( isEmptyUniqSet, uniqSetToList, UniqSet )
 \end{code}
 
index cd132e9..a7a589c 100644 (file)
@@ -54,7 +54,6 @@ import Type           ( mkTyVarTy, tyVarsOfTypes, mkTyConApp,
                          mkPredTy, splitRhoTy, mkForAllTy, isUnLiftedType, 
                          isUnboxedType, unboxedTypeKind, boxedTypeKind
                        )
-import PprType          ( {- instance Outputable Type -} )
 import FunDeps         ( tyVarFunDep, oclose )
 import Var             ( TyVar, tyVarKind )
 import VarSet
index 9c36c70..7ffce22 100644 (file)
@@ -57,7 +57,6 @@ import Type           ( Type, ThetaType, ClassContext,
                          mkSigmaTy, mkForAllTys, mkClassPred, classesOfPreds,
                          boxedTypeKind, mkArrowKind
                        )
-import PprType          ( {- instance Outputable Type -} )
 import Var             ( tyVarKind, TyVar )
 import VarSet          ( mkVarSet, emptyVarSet )
 import TyCon           ( mkAlgTyCon )
index c929ed1..156a180 100644 (file)
@@ -51,7 +51,6 @@ import Type           ( TauType, mkTyVarTys, mkTyConApp,
                          mkSigmaTy, mkDictTy, isUnboxedType,
                          splitAlgTyConApp, classesToPreds
                        )
-import PprType          ( {- instance Outputable Type -} )
 import TysWiredIn      ( voidTy )
 import Var             ( TyVar )
 import Unique          -- Keys stuff
index 27c6c14..58c73ab 100644 (file)
@@ -45,7 +45,6 @@ import Type           ( splitFunTys
                        , isForAllTy
                        , mkForAllTys
                        )
-import PprType          ( {- instance Outputable Type -} )
 
 import TysWiredIn      ( isFFIArgumentTy, isFFIResultTy, 
                          isFFIExternalTy, isAddrTy
index 517265a..1b442af 100644 (file)
@@ -49,7 +49,6 @@ import HsSyn          ( HsLit )
 import RnHsSyn         ( RenamedPat, RenamedArithSeqInfo, RenamedHsExpr )
 import Type            ( Type, Kind, PredType, ThetaType, RhoType, TauType,
                        )
-import PprType          ( {- instance Outputable Type -} )
 import ErrUtils                ( addShortErrLocLine, addShortWarnLocLine, pprBagOfErrors, ErrMsg, Message, WarnMsg )
 import CmdLineOpts      ( opt_PprStyle_Debug )
 
index 5cd7e05..88914ac 100644 (file)
@@ -37,7 +37,6 @@ import DataCon                ( DataCon, dataConSig, dataConFieldLabels,
                        )
 import Id              ( Id, idType, isDataConWrapId_maybe )
 import Type            ( Type, isTauTy, mkTyConApp, mkClassPred, boxedTypeKind )
-import PprType          ( {- instance Outputable Type -} )
 import Subst           ( substTy, substClasses )
 import TysPrim         ( charPrimTy, intPrimTy, floatPrimTy,
                          doublePrimTy, addrPrimTy
index bd9cde1..f5f6111 100644 (file)
@@ -16,6 +16,11 @@ import TypeRep       ( Type(..), funTyCon
 import Type    ( typeKind, tyVarsOfType, splitAppTy_maybe
                )
 
+import PprType ()      -- Instances
+                       -- This import isn't strictly necessary, but it makes sure that
+                       -- PprType is below Unify in the hierarchy, which in turn makes
+                       -- fewer modules boot-import PprType
+
 import Var     ( TyVar, tyVarKind )
 import VarSet
 import VarEnv  ( TyVarSubstEnv, emptySubstEnv, lookupSubstEnv, extendSubstEnv,