summaryrefslogtreecommitdiff
path: root/compiler/specialise/SpecConstr.hs
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2016-12-20 01:19:18 +0000
committerTamar Christina <tamar@zhox.com>2016-12-20 01:25:48 +0000
commit27f79255634d9789f367273504545c1ebfad90a0 (patch)
tree9d2977cd52f18abcc824dae743ec7c4a3e6f04c0 /compiler/specialise/SpecConstr.hs
parentc0c1f801f4ca26f1db68ac527341a1cf051cb7d6 (diff)
downloadhaskell-27f79255634d9789f367273504545c1ebfad90a0.tar.gz
Allow use of the external interpreter in stage1.
Summary: Now that we have -fexternal-interpreter, we can lose most of the GHCI ifdefs. This was originally added in https://phabricator.haskell.org/D2826 but that led to a compatibility issue with ghc 7.10.x on Windows. That's fixed here and the revert reverted. Reviewers: goldfire, hvr, austin, bgamari, Phyx Reviewed By: Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2884 GHC Trac Issues: #13008
Diffstat (limited to 'compiler/specialise/SpecConstr.hs')
-rw-r--r--compiler/specialise/SpecConstr.hs19
1 files changed, 3 insertions, 16 deletions
diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs
index 60632255d8..2f2087cd2e 100644
--- a/compiler/specialise/SpecConstr.hs
+++ b/compiler/specialise/SpecConstr.hs
@@ -13,10 +13,8 @@ ToDo [Oct 2013]
{-# LANGUAGE CPP #-}
module SpecConstr(
- specConstrProgram
-#ifdef GHCI
- , SpecConstrAnnotation(..)
-#endif
+ specConstrProgram,
+ SpecConstrAnnotation(..)
) where
#include "HsVersions.h"
@@ -61,12 +59,9 @@ import PrelNames ( specTyConName )
import Module
-- See Note [Forcing specialisation]
-#ifndef GHCI
-type SpecConstrAnnotation = ()
-#else
+
import TyCon ( TyCon )
import GHC.Exts( SpecConstrAnnotation(..) )
-#endif
{-
-----------------------------------------------------
@@ -954,11 +949,6 @@ 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
@@ -969,7 +959,6 @@ 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
@@ -984,9 +973,7 @@ 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