summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Builtin/Types/Prim.hs1
-rw-r--r--compiler/GHC/Builtin/Utils.hs7
-rw-r--r--compiler/GHC/Core/Type.hs8
-rw-r--r--compiler/GHC/Core/Utils.hs3
-rw-r--r--compiler/GHC/Driver/Session.hs2
-rw-r--r--compiler/GHC/Hs/ImpExp.hs3
-rw-r--r--compiler/GHC/Tc/Gen/Head.hs6
-rw-r--r--compiler/GHC/Tc/Instance/Typeable.hs2
-rw-r--r--compiler/GHC/Types/Id.hs10
9 files changed, 18 insertions, 24 deletions
diff --git a/compiler/GHC/Builtin/Types/Prim.hs b/compiler/GHC/Builtin/Types/Prim.hs
index e930b58b36..ed1f10a382 100644
--- a/compiler/GHC/Builtin/Types/Prim.hs
+++ b/compiler/GHC/Builtin/Types/Prim.hs
@@ -190,6 +190,7 @@ exposedPrimTyCons
, word64PrimTyCon
, tYPETyCon
+ , funTyCon
#include "primop-vector-tycons.hs-incl"
]
diff --git a/compiler/GHC/Builtin/Utils.hs b/compiler/GHC/Builtin/Utils.hs
index bed98838fb..3aeac609d9 100644
--- a/compiler/GHC/Builtin/Utils.hs
+++ b/compiler/GHC/Builtin/Utils.hs
@@ -133,8 +133,7 @@ knownKeyNames
-- See Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
-- in GHC.Builtin.Types.
tupleTyConName BoxedTuple 1 : tupleDataConName Boxed 1 :
- concat [ wired_tycon_kk_names funTyCon
- , concatMap wired_tycon_kk_names primTyCons
+ concat [ concatMap wired_tycon_kk_names primTyCons
, concatMap wired_tycon_kk_names wiredInTyCons
, concatMap wired_tycon_kk_names typeNatTyCons
, map idName wiredInIds
@@ -264,14 +263,14 @@ ghcPrimExports
= map (avail . idName) ghcPrimIds ++
map (avail . idName . primOpId) allThePrimOps ++
[ AvailTC n [n] []
- | tc <- funTyCon : exposedPrimTyCons, let n = tyConName tc ]
+ | tc <- exposedPrimTyCons, let n = tyConName tc ]
ghcPrimDeclDocs :: DeclDocMap
ghcPrimDeclDocs = DeclDocMap $ Map.fromList $ mapMaybe findName primOpDocs
where
names = map idName ghcPrimIds ++
map (idName . primOpId) allThePrimOps ++
- map tyConName (funTyCon : exposedPrimTyCons)
+ map tyConName exposedPrimTyCons
findName (nameStr, doc)
| Just name <- find ((nameStr ==) . getOccString) names
= Just (name, mkHsDocString doc)
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs
index 4c9bc19a7d..6e612f6e1f 100644
--- a/compiler/GHC/Core/Type.hs
+++ b/compiler/GHC/Core/Type.hs
@@ -81,7 +81,6 @@ module GHC.Core.Type (
filterOutInvisibleTypes, filterOutInferredTypes,
partitionInvisibleTypes, partitionInvisibles,
tyConArgFlags, appTyArgFlags,
- synTyConResKind,
-- ** Analyzing types
TyCoMapper(..), mapTyCo, mapTyCoX,
@@ -2891,13 +2890,6 @@ tyConsOfType ty
go_tc tc = unitUniqSet tc
go_ax ax = go_tc $ coAxiomTyCon ax
--- | Find the result 'Kind' of a type synonym,
--- after applying it to its 'arity' number of type variables
--- Actually this function works fine on data types too,
--- but they'd always return '*', so we never need to ask
-synTyConResKind :: TyCon -> Kind
-synTyConResKind tycon = piResultTys (tyConKind tycon) (mkTyVarTys (tyConTyVars tycon))
-
-- | Retrieve the free variables in this type, splitting them based
-- on whether they are used visibly or invisibly. Invisible ones come
-- first.
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index 0193c5e43d..076d5213d9 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -97,7 +97,6 @@ import GHC.Core.Multiplicity
import GHC.Types.Unique
import GHC.Utils.Outputable
import GHC.Utils.Panic
-import GHC.Builtin.Types.Prim
import GHC.Data.FastString
import GHC.Data.Maybe
import GHC.Data.List.SetOps( minusList )
@@ -139,7 +138,7 @@ exprType e@(App _ _)
= case collectArgs e of
(fun, args) -> applyTypeToArgs e (exprType fun) args
-exprType other = pprTrace "exprType" (pprCoreExpr other) alphaTy
+exprType other = pprPanic "exprType" (pprCoreExpr other)
coreAltType :: CoreAlt -> Type
-- ^ Returns the type of the alternatives right hand side
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 40987425b5..dcbe1b660c 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2880,7 +2880,7 @@ dynamic_flags_deps = [
, make_dep_flag defFlag "funfolding-keeness-factor"
(floatSuffix (\_ d -> d))
- "-funfolding-keeness-factor is no longer respected as of GHC 8.12"
+ "-funfolding-keeness-factor is no longer respected as of GHC 9.0"
, make_ord_flag defFlag "fmax-worker-args"
(intSuffix (\n d -> d {maxWorkerArgs = n}))
diff --git a/compiler/GHC/Hs/ImpExp.hs b/compiler/GHC/Hs/ImpExp.hs
index aeb9131e30..740aab2b61 100644
--- a/compiler/GHC/Hs/ImpExp.hs
+++ b/compiler/GHC/Hs/ImpExp.hs
@@ -311,9 +311,6 @@ ieWrappedName (IEType (L _ n)) = n
lieWrappedName :: LIEWrappedName name -> name
lieWrappedName (L _ n) = ieWrappedName n
-ieLWrappedName :: LIEWrappedName name -> Located name
-ieLWrappedName (L l n) = L l (ieWrappedName n)
-
replaceWrappedName :: IEWrappedName name1 -> name2 -> IEWrappedName name2
replaceWrappedName (IEName (L l _)) n = IEName (L l n)
replaceWrappedName (IEPattern (L l _)) n = IEPattern (L l n)
diff --git a/compiler/GHC/Tc/Gen/Head.hs b/compiler/GHC/Tc/Gen/Head.hs
index 163f5cda5b..50ff9508ca 100644
--- a/compiler/GHC/Tc/Gen/Head.hs
+++ b/compiler/GHC/Tc/Gen/Head.hs
@@ -593,9 +593,9 @@ lookupParents rdr
where
lookupParent :: GlobalRdrElt -> RnM (RecSelParent, GlobalRdrElt)
lookupParent gre = do { id <- tcLookupId (gre_name gre)
- ; if isRecordSelector id
- then return (recordSelectorTyCon id, gre)
- else failWithTc (notSelector (gre_name gre)) }
+ ; case recordSelectorTyCon_maybe id of
+ Just rstc -> return (rstc, gre)
+ Nothing -> failWithTc (notSelector (gre_name gre)) }
fieldNotInType :: RecSelParent -> RdrName -> SDoc
diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs
index 42112b4a30..7758caf712 100644
--- a/compiler/GHC/Tc/Instance/Typeable.hs
+++ b/compiler/GHC/Tc/Instance/Typeable.hs
@@ -350,7 +350,7 @@ mkPrimTypeableTodos
-- Note [Built-in syntax and the OrigNameCache] in "GHC.Iface.Env" for more.
ghcPrimTypeableTyCons :: [TyCon]
ghcPrimTypeableTyCons = concat
- [ [ runtimeRepTyCon, vecCountTyCon, vecElemTyCon, funTyCon ]
+ [ [ runtimeRepTyCon, vecCountTyCon, vecElemTyCon ]
, map (tupleTyCon Unboxed) [0..mAX_TUPLE_SIZE]
, map sumTyCon [2..mAX_SUM_SIZE]
, primTyCons
diff --git a/compiler/GHC/Types/Id.hs b/compiler/GHC/Types/Id.hs
index 2a45bd3389..4727ce443d 100644
--- a/compiler/GHC/Types/Id.hs
+++ b/compiler/GHC/Types/Id.hs
@@ -46,6 +46,7 @@ module GHC.Types.Id (
-- ** Taking an Id apart
idName, idType, idMult, idScaledType, idUnique, idInfo, idDetails,
recordSelectorTyCon,
+ recordSelectorTyCon_maybe,
-- ** Modifying an Id
setIdName, setIdUnique, GHC.Types.Id.setIdType, setIdMult,
@@ -438,10 +439,15 @@ That is what is happening in, say tidy_insts in GHC.Iface.Tidy.
-- | If the 'Id' is that for a record selector, extract the 'sel_tycon'. Panic otherwise.
recordSelectorTyCon :: Id -> RecSelParent
recordSelectorTyCon id
- = case Var.idDetails id of
- RecSelId { sel_tycon = parent } -> parent
+ = case recordSelectorTyCon_maybe id of
+ Just parent -> parent
_ -> panic "recordSelectorTyCon"
+recordSelectorTyCon_maybe :: Id -> Maybe RecSelParent
+recordSelectorTyCon_maybe id
+ = case Var.idDetails id of
+ RecSelId { sel_tycon = parent } -> Just parent
+ _ -> Nothing
isRecordSelector :: Id -> Bool
isNaughtyRecordSelector :: Id -> Bool