summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2019-11-14 16:16:52 +0100
committerBen Gamari <ben@smart-cactus.org>2020-03-18 00:28:39 -0400
commit19eabed96564d5ddfc3244be8dd283b96fab4a94 (patch)
treed26b1b8bed739757144e6d0125a41b7ba49ae97b
parent6b6307be67ce2954634cf0e1f40bb9f6fa4ccdf3 (diff)
downloadhaskell-19eabed96564d5ddfc3244be8dd283b96fab4a94.tar.gz
Use dataToTag# instead of getTag in deriving code.
getTag resides in base so is not useable in ghc-prim. Where we need it.
-rw-r--r--compiler/prelude/PrelNames.hs3
-rw-r--r--compiler/typecheck/TcGenDeriv.hs3
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index e0d957c00a..f0a39ee9e7 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -749,12 +749,13 @@ toList_RDR = nameRdrName toListName
compose_RDR :: RdrName
compose_RDR = varQual_RDR gHC_BASE (fsLit ".")
-not_RDR, getTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
+not_RDR, getTag_RDR, dataToTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
and_RDR, range_RDR, inRange_RDR, index_RDR,
unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName
and_RDR = varQual_RDR gHC_CLASSES (fsLit "&&")
not_RDR = varQual_RDR gHC_CLASSES (fsLit "not")
getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag")
+dataToTag_RDR = varQual_RDR gHC_PRIM (fsLit "dataToTag#")
succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ")
pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred")
minBound_RDR = varQual_RDR gHC_ENUM (fsLit "minBound")
diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs
index 7c148dfdab..b51a0a2923 100644
--- a/compiler/typecheck/TcGenDeriv.hs
+++ b/compiler/typecheck/TcGenDeriv.hs
@@ -2271,8 +2271,7 @@ untag_Expr dflags tycon ((untag_this, put_tag_here) : more) expr
put_tag_here -> .... <recursive on more>
_ -> result
-}
- = pprTrace "untagStuff" (ppr untag_this) $
- nlHsCase (nlHsPar (nlHsApp (nlHsVar getTag_RDR) (nlHsVar untag_this))) {-of-}
+ = nlHsCase (nlHsPar (nlHsApp (nlHsVar dataToTag_RDR) (nlHsVar untag_this))) {-of-}
[mkHsCaseAlt (nlVarPat put_tag_here) (untag_Expr dflags tycon more expr)]