summaryrefslogtreecommitdiff
path: root/compiler/specialise
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2016-12-17 20:08:58 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-17 20:58:35 -0500
commit52ba9470a7e85d025dc84a6789aa809cdd68b566 (patch)
treeeedb856723fb2dc0101b946af3702e6c6aee18da /compiler/specialise
parente0fe7c3131c4a18ddd9dd9f2afdd46cafc8cd7ae (diff)
downloadhaskell-52ba9470a7e85d025dc84a6789aa809cdd68b566.tar.gz
Allow use of the external interpreter in stage1.
Now that we have -fexternal-interpreter, we can lose most of the GHCI ifdefs. Reviewers: simonmar, goldfire, austin, hvr, bgamari Reviewed By: simonmar Subscribers: RyanGlScott, mpickering, angerman, thomie Differential Revision: https://phabricator.haskell.org/D2826
Diffstat (limited to 'compiler/specialise')
-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