summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Opt/Simplify.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-05-06 22:22:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-12 21:41:44 -0400
commit0ef119071347f7bc14f0fa89904b0cfd0b230ac1 (patch)
tree7a80b3942ae6bd18391f9b924ad55bb001392288 /compiler/GHC/Core/Opt/Simplify.hs
parentbfabf94f63b6644bd32982fd13ea0c8bca9aeae4 (diff)
downloadhaskell-0ef119071347f7bc14f0fa89904b0cfd0b230ac1.tar.gz
Fully remove HsVersions.h
Replace uses of WARN macro with calls to: warnPprTrace :: Bool -> SDoc -> a -> a Remove the now unused HsVersions.h Bump haddock submodule
Diffstat (limited to 'compiler/GHC/Core/Opt/Simplify.hs')
-rw-r--r--compiler/GHC/Core/Opt/Simplify.hs16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs
index da15163ba6..3728b999ee 100644
--- a/compiler/GHC/Core/Opt/Simplify.hs
+++ b/compiler/GHC/Core/Opt/Simplify.hs
@@ -10,8 +10,6 @@
{-# OPTIONS_GHC -Wno-incomplete-record-updates -Wno-incomplete-uni-patterns #-}
module GHC.Core.Opt.Simplify ( simplTopBinds, simplExpr, simplRules ) where
-#include "HsVersions.h"
-
import GHC.Prelude
import GHC.Platform
@@ -3098,9 +3096,9 @@ addAltUnfoldings env scrut case_bndr con_app
addBinderUnfolding :: SimplEnv -> Id -> Unfolding -> SimplEnv
addBinderUnfolding env bndr unf
| debugIsOn, Just tmpl <- maybeUnfoldingTemplate unf
- = WARN( not (eqType (idType bndr) (exprType tmpl)),
- ppr bndr $$ ppr (idType bndr) $$ ppr tmpl $$ ppr (exprType tmpl) )
- modifyInScope env (bndr `setIdUnfolding` unf)
+ = warnPprTrace (not (eqType (idType bndr) (exprType tmpl)))
+ (ppr bndr $$ ppr (idType bndr) $$ ppr tmpl $$ ppr (exprType tmpl)) $
+ modifyInScope env (bndr `setIdUnfolding` unf)
| otherwise
= modifyInScope env (bndr `setIdUnfolding` unf)
@@ -3264,7 +3262,7 @@ missingAlt :: SimplEnv -> Id -> [InAlt] -> SimplCont
-- it "sees" that the entire branch of an outer case is
-- inaccessible. So we simply put an error case here instead.
missingAlt env case_bndr _ cont
- = WARN( True, text "missingAlt" <+> ppr case_bndr )
+ = warnPprTrace True (text "missingAlt" <+> ppr case_bndr) $
-- See Note [Avoiding space leaks in OutType]
let cont_ty = contResultType cont
in seqType cont_ty `seq`
@@ -3533,9 +3531,9 @@ mkDupableAlt platform case_bndr jfloats (Alt con bndrs' rhs')
unf = mkInlineUnfolding simpl_opts rhs
rhs = mkConApp2 dc (tyConAppArgs scrut_ty) bndrs'
- LitAlt {} -> WARN( True, text "mkDupableAlt"
- <+> ppr case_bndr <+> ppr con )
- case_bndr
+ LitAlt {} -> warnPprTrace True
+ (text "mkDupableAlt" <+> ppr case_bndr <+> ppr con)
+ case_bndr
-- The case binder is alive but trivial, so why has
-- it not been substituted away?