diff options
author | Tamar Christina <tamar@zhox.com> | 2016-12-19 19:09:18 +0000 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2016-12-19 19:09:18 +0000 |
commit | f1dfce1cb2a823696d6d3a9ea41c2bc73d949f12 (patch) | |
tree | b14692ca8e33e8f925a1fa47542eb3499fc79f0e /compiler/specialise/SpecConstr.hs | |
parent | bb74bc79daf8b91b21a1b68b0a406828d188ed92 (diff) | |
download | haskell-f1dfce1cb2a823696d6d3a9ea41c2bc73d949f12.tar.gz |
Revert "Allow use of the external interpreter in stage1."
This reverts commit 52ba9470a7e85d025dc84a6789aa809cdd68b566.
Diffstat (limited to 'compiler/specialise/SpecConstr.hs')
-rw-r--r-- | compiler/specialise/SpecConstr.hs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index 2f2087cd2e..60632255d8 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -13,8 +13,10 @@ ToDo [Oct 2013] {-# LANGUAGE CPP #-} module SpecConstr( - specConstrProgram, - SpecConstrAnnotation(..) + specConstrProgram +#ifdef GHCI + , SpecConstrAnnotation(..) +#endif ) where #include "HsVersions.h" @@ -59,9 +61,12 @@ import PrelNames ( specTyConName ) import Module -- See Note [Forcing specialisation] - +#ifndef GHCI +type SpecConstrAnnotation = () +#else import TyCon ( TyCon ) import GHC.Exts( SpecConstrAnnotation(..) ) +#endif {- ----------------------------------------------------- @@ -949,6 +954,11 @@ ignoreType :: ScEnv -> Type -> Bool ignoreDataCon :: ScEnv -> DataCon -> Bool forceSpecBndr :: ScEnv -> Var -> Bool +#ifndef GHCI +ignoreType _ _ = False +ignoreDataCon _ _ = False +#else /* GHCI */ + ignoreDataCon env dc = ignoreTyCon env (dataConTyCon dc) ignoreType env ty @@ -959,6 +969,7 @@ ignoreType env ty ignoreTyCon :: ScEnv -> TyCon -> Bool ignoreTyCon env tycon = lookupUFM (sc_annotations env) tycon == Just NoSpecConstr +#endif /* GHCI */ forceSpecBndr env var = forceSpecFunTy env . snd . splitForAllTys . varType $ var @@ -973,7 +984,9 @@ forceSpecArgTy env ty | Just (tycon, tys) <- splitTyConApp_maybe ty , tycon /= funTyCon = tyConName tycon == specTyConName +#ifdef GHCI || lookupUFM (sc_annotations env) tycon == Just ForceSpecConstr +#endif || any (forceSpecArgTy env) tys forceSpecArgTy _ _ = False |