summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-05-07 15:55:04 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-12 21:41:44 -0400
commit67a5a91ef5e61f3b3c84481d8a396ed48cd5d96e (patch)
tree109ee95b75507cd49355135d53da2dbc9d9231cb
parent0ef119071347f7bc14f0fa89904b0cfd0b230ac1 (diff)
downloadhaskell-67a5a91ef5e61f3b3c84481d8a396ed48cd5d96e.tar.gz
Remove useless {-# LANGUAGE CPP #-} pragmas
-rw-r--r--compiler/GHC.hs3
-rw-r--r--compiler/GHC/Builtin/Types.hs1
-rw-r--r--compiler/GHC/Builtin/Uniques.hs2
-rw-r--r--compiler/GHC/Builtin/Utils.hs2
-rw-r--r--compiler/GHC/ByteCode/InfoTable.hs2
-rw-r--r--compiler/GHC/ByteCode/Instr.hs2
-rw-r--r--compiler/GHC/ByteCode/Linker.hs1
-rw-r--r--compiler/GHC/Cmm/CLabel.hs1
-rw-r--r--compiler/GHC/Cmm/Info.hs2
-rw-r--r--compiler/GHC/CmmToAsm.hs1
-rw-r--r--compiler/GHC/CmmToAsm/CFG.hs1
-rw-r--r--compiler/GHC/CmmToAsm/Monad.hs1
-rw-r--r--compiler/GHC/CmmToAsm/PPC/CodeGen.hs1
-rw-r--r--compiler/GHC/CmmToAsm/PPC/Instr.hs2
-rw-r--r--compiler/GHC/CmmToAsm/PPC/RegInfo.hs1
-rw-r--r--compiler/GHC/CmmToAsm/PPC/Regs.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Ppr.hs3
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Linear.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Linear/State.hs2
-rw-r--r--compiler/GHC/CmmToAsm/Reg/Target.hs2
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/CodeGen.hs2
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/Instr.hs2
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/Ppr.hs1
-rw-r--r--compiler/GHC/CmmToAsm/X86/CodeGen.hs1
-rw-r--r--compiler/GHC/CmmToAsm/X86/Instr.hs2
-rw-r--r--compiler/GHC/CmmToAsm/X86/Ppr.hs2
-rw-r--r--compiler/GHC/CmmToAsm/X86/RegInfo.hs2
-rw-r--r--compiler/GHC/CmmToAsm/X86/Regs.hs2
-rw-r--r--compiler/GHC/CmmToC.hs1
-rw-r--r--compiler/GHC/CmmToLlvm.hs2
-rw-r--r--compiler/GHC/CmmToLlvm/CodeGen.hs6
-rw-r--r--compiler/GHC/CmmToLlvm/Data.hs2
-rw-r--r--compiler/GHC/CmmToLlvm/Ppr.hs2
-rw-r--r--compiler/GHC/CmmToLlvm/Regs.hs2
-rw-r--r--compiler/GHC/Core.hs2
-rw-r--r--compiler/GHC/Core/Class.hs2
-rw-r--r--compiler/GHC/Core/Coercion.hs1
-rw-r--r--compiler/GHC/Core/Coercion/Axiom.hs1
-rw-r--r--compiler/GHC/Core/ConLike.hs2
-rw-r--r--compiler/GHC/Core/DataCon.hs2
-rw-r--r--compiler/GHC/Core/FVs.hs1
-rw-r--r--compiler/GHC/Core/FamInstEnv.hs1
-rw-r--r--compiler/GHC/Core/InstEnv.hs2
-rw-r--r--compiler/GHC/Core/Lint.hs1
-rw-r--r--compiler/GHC/Core/Make.hs2
-rw-r--r--compiler/GHC/Core/Map/Expr.hs1
-rw-r--r--compiler/GHC/Core/Opt/Arity.hs1
-rw-r--r--compiler/GHC/Core/Opt/CSE.hs2
-rw-r--r--compiler/GHC/Core/Opt/ConstantFold.hs1
-rw-r--r--compiler/GHC/Core/Opt/CprAnal.hs1
-rw-r--r--compiler/GHC/Core/Opt/DmdAnal.hs1
-rw-r--r--compiler/GHC/Core/Opt/FloatIn.hs2
-rw-r--r--compiler/GHC/Core/Opt/FloatOut.hs2
-rw-r--r--compiler/GHC/Core/Opt/LiberateCase.hs2
-rw-r--r--compiler/GHC/Core/Opt/Monad.hs2
-rw-r--r--compiler/GHC/Core/Opt/OccurAnal.hs1
-rw-r--r--compiler/GHC/Core/Opt/SetLevels.hs2
-rw-r--r--compiler/GHC/Core/Opt/Simplify.hs2
-rw-r--r--compiler/GHC/Core/Opt/Simplify/Env.hs2
-rw-r--r--compiler/GHC/Core/Opt/Simplify/Utils.hs2
-rw-r--r--compiler/GHC/Core/Opt/SpecConstr.hs2
-rw-r--r--compiler/GHC/Core/Opt/Specialise.hs2
-rw-r--r--compiler/GHC/Core/Opt/StaticArgs.hs2
-rw-r--r--compiler/GHC/Core/Opt/WorkWrap.hs2
-rw-r--r--compiler/GHC/Core/Opt/WorkWrap/Utils.hs2
-rw-r--r--compiler/GHC/Core/PatSyn.hs2
-rw-r--r--compiler/GHC/Core/Rules.hs10
-rw-r--r--compiler/GHC/Core/SimpleOpt.hs2
-rw-r--r--compiler/GHC/Core/Subst.hs2
-rw-r--r--compiler/GHC/Core/Tidy.hs2
-rw-r--r--compiler/GHC/Core/TyCo/FVs.hs2
-rw-r--r--compiler/GHC/Core/TyCo/Rep.hs2
-rw-r--r--compiler/GHC/Core/TyCo/Subst.hs2
-rw-r--r--compiler/GHC/Core/TyCon.hs2
-rw-r--r--compiler/GHC/Core/TyCon/Env.hs2
-rw-r--r--compiler/GHC/Core/TyCon/RecWalk.hs2
-rw-r--r--compiler/GHC/Core/TyCon/Set.hs2
-rw-r--r--compiler/GHC/Core/Type.hs2
-rw-r--r--compiler/GHC/Core/Unfold.hs2
-rw-r--r--compiler/GHC/Core/Unfold/Make.hs2
-rw-r--r--compiler/GHC/Core/Unify.hs2
-rw-r--r--compiler/GHC/Core/Utils.hs10
-rw-r--r--compiler/GHC/CoreToIface.hs2
-rw-r--r--compiler/GHC/CoreToStg.hs2
-rw-r--r--compiler/GHC/CoreToStg/Prep.hs2
-rw-r--r--compiler/GHC/Data/Bag.hs2
-rw-r--r--compiler/GHC/Data/FastString.hs4
-rw-r--r--compiler/GHC/Data/Graph/Directed.hs2
-rw-r--r--compiler/GHC/Data/IOEnv.hs2
-rw-r--r--compiler/GHC/Data/List/SetOps.hs2
-rw-r--r--compiler/GHC/Data/Maybe.hs2
-rw-r--r--compiler/GHC/Data/Pair.hs2
-rw-r--r--compiler/GHC/Driver/Backpack.hs2
-rw-r--r--compiler/GHC/Driver/CmdLine.hs2
-rw-r--r--compiler/GHC/Driver/CodeOutput.hs2
-rw-r--r--compiler/GHC/Driver/Env.hs2
-rw-r--r--compiler/GHC/Driver/Hooks.hs2
-rw-r--r--compiler/GHC/Driver/Main.hs2
-rw-r--r--compiler/GHC/Driver/Make.hs10
-rw-r--r--compiler/GHC/Driver/MakeFile.hs2
-rw-r--r--compiler/GHC/Driver/Monad.hs2
-rw-r--r--compiler/GHC/Driver/Phases.hs2
-rw-r--r--compiler/GHC/Driver/Pipeline.hs3
-rw-r--r--compiler/GHC/Driver/Plugins.hs2
-rw-r--r--compiler/GHC/Hs/Decls.hs2
-rw-r--r--compiler/GHC/Hs/Doc.hs2
-rw-r--r--compiler/GHC/Hs/Lit.hs1
-rw-r--r--compiler/GHC/Hs/Type.hs2
-rw-r--r--compiler/GHC/Hs/Utils.hs2
-rw-r--r--compiler/GHC/HsToCore.hs2
-rw-r--r--compiler/GHC/HsToCore/Arrows.hs2
-rw-r--r--compiler/GHC/HsToCore/Binds.hs2
-rw-r--r--compiler/GHC/HsToCore/Expr.hs2
-rw-r--r--compiler/GHC/HsToCore/Foreign/Call.hs2
-rw-r--r--compiler/GHC/HsToCore/Foreign/Decl.hs2
-rw-r--r--compiler/GHC/HsToCore/GuardedRHSs.hs2
-rw-r--r--compiler/GHC/HsToCore/ListComp.hs2
-rw-r--r--compiler/GHC/HsToCore/Match.hs2
-rw-r--r--compiler/GHC/HsToCore/Match/Constructor.hs2
-rw-r--r--compiler/GHC/HsToCore/Match/Literal.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Check.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Desugar.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Ppr.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Solver.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Solver/Types.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Types.hs2
-rw-r--r--compiler/GHC/HsToCore/Pmc/Utils.hs2
-rw-r--r--compiler/GHC/HsToCore/Quote.hs2
-rw-r--r--compiler/GHC/HsToCore/Usage.hs2
-rw-r--r--compiler/GHC/HsToCore/Utils.hs2
-rw-r--r--compiler/GHC/Iface/Binary.hs2
-rw-r--r--compiler/GHC/Iface/Env.hs2
-rw-r--r--compiler/GHC/Iface/Load.hs2
-rw-r--r--compiler/GHC/Iface/Make.hs2
-rw-r--r--compiler/GHC/Iface/Recomp.hs11
-rw-r--r--compiler/GHC/Iface/Recomp/Binary.hs2
-rw-r--r--compiler/GHC/Iface/Rename.hs2
-rw-r--r--compiler/GHC/Iface/Syntax.hs2
-rw-r--r--compiler/GHC/Iface/Tidy.hs2
-rw-r--r--compiler/GHC/Iface/Type.hs2
-rw-r--r--compiler/GHC/IfaceToCore.hs2
-rw-r--r--compiler/GHC/Linker/Loader.hs3
-rw-r--r--compiler/GHC/Llvm/Ppr.hs2
-rw-r--r--compiler/GHC/Llvm/Types.hs2
-rw-r--r--compiler/GHC/Parser/CharClass.hs2
-rw-r--r--compiler/GHC/Parser/Header.hs2
-rw-r--r--compiler/GHC/Parser/PostProcess.hs2
-rw-r--r--compiler/GHC/Rename/Env.hs2
-rw-r--r--compiler/GHC/Rename/Expr.hs2
-rw-r--r--compiler/GHC/Rename/HsType.hs2
-rw-r--r--compiler/GHC/Rename/Module.hs2
-rw-r--r--compiler/GHC/Rename/Names.hs2
-rw-r--r--compiler/GHC/Rename/Pat.hs1
-rw-r--r--compiler/GHC/Rename/Splice.hs2
-rw-r--r--compiler/GHC/Runtime/Eval.hs2
-rw-r--r--compiler/GHC/Runtime/Heap/Inspect.hs2
-rw-r--r--compiler/GHC/Runtime/Heap/Layout.hs3
-rw-r--r--compiler/GHC/Runtime/Interpreter.hs2
-rw-r--r--compiler/GHC/Runtime/Loader.hs2
-rw-r--r--compiler/GHC/Settings.hs2
-rw-r--r--compiler/GHC/Settings/IO.hs2
-rw-r--r--compiler/GHC/Stg/DepAnal.hs2
-rw-r--r--compiler/GHC/Stg/Lift.hs2
-rw-r--r--compiler/GHC/Stg/Lift/Monad.hs2
-rw-r--r--compiler/GHC/Stg/Pipeline.hs2
-rw-r--r--compiler/GHC/Stg/Stats.hs2
-rw-r--r--compiler/GHC/Stg/Subst.hs2
-rw-r--r--compiler/GHC/Stg/Syntax.hs2
-rw-r--r--compiler/GHC/Stg/Unarise.hs2
-rw-r--r--compiler/GHC/StgToByteCode.hs2
-rw-r--r--compiler/GHC/StgToCmm.hs2
-rw-r--r--compiler/GHC/StgToCmm/Closure.hs2
-rw-r--r--compiler/GHC/StgToCmm/DataCon.hs2
-rw-r--r--compiler/GHC/StgToCmm/Env.hs2
-rw-r--r--compiler/GHC/StgToCmm/Expr.hs2
-rw-r--r--compiler/GHC/StgToCmm/Lit.hs2
-rw-r--r--compiler/GHC/StgToCmm/Prim.hs2
-rw-r--r--compiler/GHC/StgToCmm/Types.hs2
-rw-r--r--compiler/GHC/StgToCmm/Utils.hs2
-rw-r--r--compiler/GHC/SysTools.hs2
-rw-r--r--compiler/GHC/SysTools/Ar.hs3
-rw-r--r--compiler/GHC/SysTools/Tasks.hs21
-rw-r--r--compiler/GHC/Tc/Deriv.hs2
-rw-r--r--compiler/GHC/Tc/Deriv/Functor.hs2
-rw-r--r--compiler/GHC/Tc/Deriv/Generate.hs2
-rw-r--r--compiler/GHC/Tc/Deriv/Generics.hs2
-rw-r--r--compiler/GHC/Tc/Deriv/Infer.hs2
-rw-r--r--compiler/GHC/Tc/Errors.hs2
-rw-r--r--compiler/GHC/Tc/Errors/Hole.hs2
-rw-r--r--compiler/GHC/Tc/Gen/App.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Bind.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Expr.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Foreign.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Head.hs2
-rw-r--r--compiler/GHC/Tc/Gen/HsType.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Match.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Pat.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Sig.hs2
-rw-r--r--compiler/GHC/Tc/Gen/Splice.hs-boot1
-rw-r--r--compiler/GHC/Tc/Instance/Class.hs2
-rw-r--r--compiler/GHC/Tc/Instance/Family.hs2
-rw-r--r--compiler/GHC/Tc/Instance/FunDeps.hs2
-rw-r--r--compiler/GHC/Tc/Instance/Typeable.hs2
-rw-r--r--compiler/GHC/Tc/Plugin.hs2
-rw-r--r--compiler/GHC/Tc/Solver.hs2
-rw-r--r--compiler/GHC/Tc/Solver/Interact.hs2
-rw-r--r--compiler/GHC/Tc/Solver/Rewrite.hs2
-rw-r--r--compiler/GHC/Tc/TyCl.hs3
-rw-r--r--compiler/GHC/Tc/TyCl/Build.hs2
-rw-r--r--compiler/GHC/Tc/TyCl/Class.hs2
-rw-r--r--compiler/GHC/Tc/TyCl/Instance.hs2
-rw-r--r--compiler/GHC/Tc/TyCl/Utils.hs2
-rw-r--r--compiler/GHC/Tc/Types.hs2
-rw-r--r--compiler/GHC/Tc/Types/Constraint.hs2
-rw-r--r--compiler/GHC/Tc/Types/Evidence.hs2
-rw-r--r--compiler/GHC/Tc/Types/Origin.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Backpack.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Env.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Instantiate.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Monad.hs1
-rw-r--r--compiler/GHC/Tc/Utils/TcMType.hs18
-rw-r--r--compiler/GHC/Tc/Utils/TcType.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Unify.hs2
-rw-r--r--compiler/GHC/Tc/Utils/Zonk.hs2
-rw-r--r--compiler/GHC/Tc/Validity.hs2
-rw-r--r--compiler/GHC/Types/Avail.hs2
-rw-r--r--compiler/GHC/Types/Demand.hs2
-rw-r--r--compiler/GHC/Types/Id.hs2
-rw-r--r--compiler/GHC/Types/Id/Info.hs2
-rw-r--r--compiler/GHC/Types/Id/Make.hs2
-rw-r--r--compiler/GHC/Types/Literal.hs2
-rw-r--r--compiler/GHC/Types/Name/Cache.hs2
-rw-r--r--compiler/GHC/Types/Name/Env.hs2
-rw-r--r--compiler/GHC/Types/Name/Ppr.hs2
-rw-r--r--compiler/GHC/Types/Name/Reader.hs3
-rw-r--r--compiler/GHC/Types/Name/Set.hs2
-rw-r--r--compiler/GHC/Types/Name/Shape.hs2
-rw-r--r--compiler/GHC/Types/RepType.hs2
-rw-r--r--compiler/GHC/Types/TyThing/Ppr.hs2
-rw-r--r--compiler/GHC/Types/Unique.hs3
-rw-r--r--compiler/GHC/Types/Unique/FM.hs2
-rw-r--r--compiler/GHC/Types/Var.hs2
-rw-r--r--compiler/GHC/Types/Var/Set.hs2
-rw-r--r--compiler/GHC/Unit/Finder.hs2
-rw-r--r--compiler/GHC/Unit/Info.hs2
-rw-r--r--compiler/GHC/Unit/State.hs2
-rw-r--r--compiler/GHC/Utils/Binary.hs1
-rw-r--r--compiler/GHC/Utils/Error.hs1
-rw-r--r--compiler/GHC/Utils/Fingerprint.hs2
-rw-r--r--compiler/GHC/Utils/IO/Unsafe.hs2
-rw-r--r--compiler/GHC/Utils/Panic.hs3
-rw-r--r--compiler/GHC/Utils/Panic/Plain.hs2
-rw-r--r--compiler/Language/Haskell/Syntax/Decls.hs2
-rw-r--r--compiler/Language/Haskell/Syntax/Expr.hs2
-rw-r--r--compiler/Language/Haskell/Syntax/Lit.hs2
-rw-r--r--compiler/Language/Haskell/Syntax/Pat.hs2
-rw-r--r--compiler/Language/Haskell/Syntax/Type.hs2
-rw-r--r--compiler/ghc.mk1
-rw-r--r--ghc/GHCi/UI.hs2
-rw-r--r--ghc/GHCi/UI/Monad.hs2
-rw-r--r--hadrian/src/Rules/Generate.hs3
265 files changed, 272 insertions, 314 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 7f37a7537d..44e09a23ba 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, NondecreasingIndentation, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE NondecreasingIndentation, ScopedTypeVariables #-}
{-# LANGUAGE TupleSections, NamedFieldPuns #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Builtin/Types.hs b/compiler/GHC/Builtin/Types.hs
index 51950d6781..e6f988e841 100644
--- a/compiler/GHC/Builtin/Types.hs
+++ b/compiler/GHC/Builtin/Types.hs
@@ -4,7 +4,6 @@
Wired-in knowledge about {\em non-primitive} types
-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Builtin/Uniques.hs b/compiler/GHC/Builtin/Uniques.hs
index a361d10766..12c84ba55b 100644
--- a/compiler/GHC/Builtin/Uniques.hs
+++ b/compiler/GHC/Builtin/Uniques.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | This is where we define a mapping from Uniques to their associated
-- known-key Names for things associated with tuples and sums. We use this
diff --git a/compiler/GHC/Builtin/Utils.hs b/compiler/GHC/Builtin/Utils.hs
index 5905e2441a..ab46812040 100644
--- a/compiler/GHC/Builtin/Utils.hs
+++ b/compiler/GHC/Builtin/Utils.hs
@@ -3,7 +3,7 @@
-}
-{-# LANGUAGE CPP #-}
+
-- | The @GHC.Builtin.Utils@ interface to the compiler's prelude knowledge.
--
diff --git a/compiler/GHC/ByteCode/InfoTable.hs b/compiler/GHC/ByteCode/InfoTable.hs
index 50fa6f54f8..4f17b2aa12 100644
--- a/compiler/GHC/ByteCode/InfoTable.hs
+++ b/compiler/GHC/ByteCode/InfoTable.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -optc-DNON_POSIX_SOURCE #-}
--
diff --git a/compiler/GHC/ByteCode/Instr.hs b/compiler/GHC/ByteCode/Instr.hs
index 85600703fa..cb1fb4d335 100644
--- a/compiler/GHC/ByteCode/Instr.hs
+++ b/compiler/GHC/ByteCode/Instr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
--
diff --git a/compiler/GHC/ByteCode/Linker.hs b/compiler/GHC/ByteCode/Linker.hs
index 38e18a51da..3e36e41073 100644
--- a/compiler/GHC/ByteCode/Linker.hs
+++ b/compiler/GHC/ByteCode/Linker.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs
index ca1036afdd..cda35a4943 100644
--- a/compiler/GHC/Cmm/CLabel.hs
+++ b/compiler/GHC/Cmm/CLabel.hs
@@ -6,7 +6,6 @@
--
-----------------------------------------------------------------------------
-{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs
index a9fc93f9bb..fa8cc27e1b 100644
--- a/compiler/GHC/Cmm/Info.hs
+++ b/compiler/GHC/Cmm/Info.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Cmm.Info (
mkEmptyContInfoTable,
cmmToRawCmm,
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs
index cda6d46eed..00ef59660f 100644
--- a/compiler/GHC/CmmToAsm.hs
+++ b/compiler/GHC/CmmToAsm.hs
@@ -6,7 +6,6 @@
-- -----------------------------------------------------------------------------
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs
index 0e5d359de4..21e35afafe 100644
--- a/compiler/GHC/CmmToAsm/CFG.hs
+++ b/compiler/GHC/CmmToAsm/CFG.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Rank2Types #-}
diff --git a/compiler/GHC/CmmToAsm/Monad.hs b/compiler/GHC/CmmToAsm/Monad.hs
index 96fe1e194c..fa6a8706a1 100644
--- a/compiler/GHC/CmmToAsm/Monad.hs
+++ b/compiler/GHC/CmmToAsm/Monad.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE BangPatterns #-}
diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
index 520dd3445a..c3e66c02ac 100644
--- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/CmmToAsm/PPC/Instr.hs b/compiler/GHC/CmmToAsm/PPC/Instr.hs
index 26155ac022..92567989ed 100644
--- a/compiler/GHC/CmmToAsm/PPC/Instr.hs
+++ b/compiler/GHC/CmmToAsm/PPC/Instr.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE CPP #-}
-
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/CmmToAsm/PPC/RegInfo.hs b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs
index e2ddf97323..017014c70f 100644
--- a/compiler/GHC/CmmToAsm/PPC/RegInfo.hs
+++ b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/CmmToAsm/PPC/Regs.hs b/compiler/GHC/CmmToAsm/PPC/Regs.hs
index 2d5ae527cc..9d2d49a58f 100644
--- a/compiler/GHC/CmmToAsm/PPC/Regs.hs
+++ b/compiler/GHC/CmmToAsm/PPC/Regs.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE CPP #-}
-
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 1994-2004
diff --git a/compiler/GHC/CmmToAsm/Ppr.hs b/compiler/GHC/CmmToAsm/Ppr.hs
index e4e9d7708e..12b2402493 100644
--- a/compiler/GHC/CmmToAsm/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/Ppr.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, MagicHash #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE MagicHash #-}
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
index 6b883f53eb..76de71d77c 100644
--- a/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, CPP, DeriveFunctor #-}
+{-# LANGUAGE BangPatterns, DeriveFunctor #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
index 9f22594e33..1050fbaa96 100644
--- a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE CPP #-}
-
module GHC.CmmToAsm.Reg.Graph.TrivColorable (
trivColorable,
)
diff --git a/compiler/GHC/CmmToAsm/Reg/Linear.hs b/compiler/GHC/CmmToAsm/Reg/Linear.hs
index 92d5ccdb36..88fdcd6bce 100644
--- a/compiler/GHC/CmmToAsm/Reg/Linear.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Linear.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
+{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
{-# LANGUAGE ConstraintKinds #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
index d685945943..d501718c4a 100644
--- a/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE CPP #-}
-
module GHC.CmmToAsm.Reg.Linear.FreeRegs (
FR(..),
maxSpillSlots
diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
index 4fdc5c96cf..24a75121b8 100644
--- a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, PatternSynonyms, DeriveFunctor #-}
+{-# LANGUAGE PatternSynonyms, DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnboxedTuples #-}
diff --git a/compiler/GHC/CmmToAsm/Reg/Target.hs b/compiler/GHC/CmmToAsm/Reg/Target.hs
index 396abc357d..4611c3a8e8 100644
--- a/compiler/GHC/CmmToAsm/Reg/Target.hs
+++ b/compiler/GHC/CmmToAsm/Reg/Target.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Hard wired things related to registers.
-- This is module is preventing the native code generator being able to
-- emit code for non-host architectures.
diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs
index 52a644d528..974aec02c2 100644
--- a/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/CmmToAsm/SPARC/Instr.hs b/compiler/GHC/CmmToAsm/SPARC/Instr.hs
index c5fa2120cd..3aeeb4d976 100644
--- a/compiler/GHC/CmmToAsm/SPARC/Instr.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/Instr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/CmmToAsm/SPARC/Ppr.hs b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs
index 13047b559f..b4028fe3b4 100644
--- a/compiler/GHC/CmmToAsm/SPARC/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs
index 11c0564b5d..7f9b842c1b 100644
--- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE TupleSections #-}
diff --git a/compiler/GHC/CmmToAsm/X86/Instr.hs b/compiler/GHC/CmmToAsm/X86/Instr.hs
index 5488079e3f..e48d0922d8 100644
--- a/compiler/GHC/CmmToAsm/X86/Instr.hs
+++ b/compiler/GHC/CmmToAsm/X86/Instr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, TypeFamilies #-}
+{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/CmmToAsm/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs
index 00ace38516..5f030b8d58 100644
--- a/compiler/GHC/CmmToAsm/X86/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/CmmToAsm/X86/RegInfo.hs b/compiler/GHC/CmmToAsm/X86/RegInfo.hs
index 69d64f67e7..05f2e976ec 100644
--- a/compiler/GHC/CmmToAsm/X86/RegInfo.hs
+++ b/compiler/GHC/CmmToAsm/X86/RegInfo.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.CmmToAsm.X86.RegInfo (
mkVirtualReg,
regDotColor
diff --git a/compiler/GHC/CmmToAsm/X86/Regs.hs b/compiler/GHC/CmmToAsm/X86/Regs.hs
index c2462e9397..b1b45042fb 100644
--- a/compiler/GHC/CmmToAsm/X86/Regs.hs
+++ b/compiler/GHC/CmmToAsm/X86/Regs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.CmmToAsm.X86.Regs (
-- squeese functions for the graph allocator
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index 59d1203367..d5457d4fae 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/CmmToLlvm.hs b/compiler/GHC/CmmToLlvm.hs
index 050dee2e9b..d36be3f6a6 100644
--- a/compiler/GHC/CmmToLlvm.hs
+++ b/compiler/GHC/CmmToLlvm.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, TypeFamilies, ViewPatterns, OverloadedStrings #-}
+{-# LANGUAGE TypeFamilies, ViewPatterns, OverloadedStrings #-}
-- -----------------------------------------------------------------------------
-- | This is the top-level module in the LLVM code generator.
diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs
index 584f7f641a..5ccadae4fa 100644
--- a/compiler/GHC/CmmToLlvm/CodeGen.hs
+++ b/compiler/GHC/CmmToLlvm/CodeGen.hs
@@ -1,9 +1,9 @@
-{-# LANGUAGE CPP, GADTs, MultiWayIf #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE GADTs, MultiWayIf #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
--- ----------------------------------------------------------------------------
+
-- | Handle conversion of CmmProc to LLVM code.
---
module GHC.CmmToLlvm.CodeGen ( genLlvmProc ) where
import GHC.Prelude
diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
index ff3ec6ebd1..a76f5ee152 100644
--- a/compiler/GHC/CmmToLlvm/Data.hs
+++ b/compiler/GHC/CmmToLlvm/Data.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- ----------------------------------------------------------------------------
-- | Handle conversion of CmmData to LLVM code.
--
diff --git a/compiler/GHC/CmmToLlvm/Ppr.hs b/compiler/GHC/CmmToLlvm/Ppr.hs
index 23bb0bee65..30b671ffb4 100644
--- a/compiler/GHC/CmmToLlvm/Ppr.hs
+++ b/compiler/GHC/CmmToLlvm/Ppr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- ----------------------------------------------------------------------------
-- | Pretty print helpers for the LLVM Code generator.
diff --git a/compiler/GHC/CmmToLlvm/Regs.hs b/compiler/GHC/CmmToLlvm/Regs.hs
index 64a80d9e58..b18df77ed4 100644
--- a/compiler/GHC/CmmToLlvm/Regs.hs
+++ b/compiler/GHC/CmmToLlvm/Regs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
--------------------------------------------------------------------------------
-- | Deal with Cmm registers
diff --git a/compiler/GHC/Core.hs b/compiler/GHC/Core.hs
index c8b3dd65d0..f91468baf5 100644
--- a/compiler/GHC/Core.hs
+++ b/compiler/GHC/Core.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
-{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts #-}
+{-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE BangPatterns #-}
diff --git a/compiler/GHC/Core/Class.hs b/compiler/GHC/Core/Class.hs
index 8319526322..99359fc2a1 100644
--- a/compiler/GHC/Core/Class.hs
+++ b/compiler/GHC/Core/Class.hs
@@ -3,7 +3,7 @@
--
-- The @Class@ datatype
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Class (
Class,
diff --git a/compiler/GHC/Core/Coercion.hs b/compiler/GHC/Core/Coercion.hs
index e8207bad35..b9856dbef2 100644
--- a/compiler/GHC/Core/Coercion.hs
+++ b/compiler/GHC/Core/Coercion.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Core/Coercion/Axiom.hs b/compiler/GHC/Core/Coercion/Axiom.hs
index f9ec62e973..5db9f17161 100644
--- a/compiler/GHC/Core/Coercion/Axiom.hs
+++ b/compiler/GHC/Core/Coercion/Axiom.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
diff --git a/compiler/GHC/Core/ConLike.hs b/compiler/GHC/Core/ConLike.hs
index 2c2a21d3ab..868d4a6fed 100644
--- a/compiler/GHC/Core/ConLike.hs
+++ b/compiler/GHC/Core/ConLike.hs
@@ -5,7 +5,7 @@
\section[ConLike]{@ConLike@: Constructor-like things}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.ConLike (
ConLike(..)
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs
index 2a29a9aac4..bbc02310f7 100644
--- a/compiler/GHC/Core/DataCon.hs
+++ b/compiler/GHC/Core/DataCon.hs
@@ -5,7 +5,7 @@
\section[DataCon]{@DataCon@: Data Constructors}
-}
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable #-}
module GHC.Core.DataCon (
-- * Main data types
diff --git a/compiler/GHC/Core/FVs.hs b/compiler/GHC/Core/FVs.hs
index af23ffb45a..e4663ad075 100644
--- a/compiler/GHC/Core/FVs.hs
+++ b/compiler/GHC/Core/FVs.hs
@@ -5,7 +5,6 @@
Taken quite directly from the Peyton Jones/Lester paper.
-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
-- | A module concerned with finding the free variables of an expression.
diff --git a/compiler/GHC/Core/FamInstEnv.hs b/compiler/GHC/Core/FamInstEnv.hs
index b4b2100705..5429a2ec4a 100644
--- a/compiler/GHC/Core/FamInstEnv.hs
+++ b/compiler/GHC/Core/FamInstEnv.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Core/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs
index 02f2183d63..b5688e3ab2 100644
--- a/compiler/GHC/Core/InstEnv.hs
+++ b/compiler/GHC/Core/InstEnv.hs
@@ -7,7 +7,7 @@
The bits common to GHC.Tc.TyCl.Instance and GHC.Tc.Deriv.
-}
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable #-}
module GHC.Core.InstEnv (
DFunId, InstMatch, ClsInstLookupResult,
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs
index 86be68cdb6..ad3bad1d7d 100644
--- a/compiler/GHC/Core/Lint.hs
+++ b/compiler/GHC/Core/Lint.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs
index b174379bc9..0106cac484 100644
--- a/compiler/GHC/Core/Make.hs
+++ b/compiler/GHC/Core/Make.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Map/Expr.hs b/compiler/GHC/Core/Map/Expr.hs
index 8d47a947b4..9cff1d33a1 100644
--- a/compiler/GHC/Core/Map/Expr.hs
+++ b/compiler/GHC/Core/Map/Expr.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs
index 004e667e1b..9985a14f0e 100644
--- a/compiler/GHC/Core/Opt/Arity.hs
+++ b/compiler/GHC/Core/Opt/Arity.hs
@@ -7,7 +7,6 @@
-}
{-# LANGUAGE CPP #-}
-
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-- | Arity and eta expansion
diff --git a/compiler/GHC/Core/Opt/CSE.hs b/compiler/GHC/Core/Opt/CSE.hs
index cb5d446fa5..6b5a12e9f1 100644
--- a/compiler/GHC/Core/Opt/CSE.hs
+++ b/compiler/GHC/Core/Opt/CSE.hs
@@ -4,7 +4,7 @@
\section{Common subexpression}
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/ConstantFold.hs b/compiler/GHC/Core/Opt/ConstantFold.hs
index 68ac1379e8..6bd7f41d3b 100644
--- a/compiler/GHC/Core/Opt/ConstantFold.hs
+++ b/compiler/GHC/Core/Opt/ConstantFold.hs
@@ -11,7 +11,6 @@ ToDo:
-}
{-# LANGUAGE AllowAmbiguousTypes #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
diff --git a/compiler/GHC/Core/Opt/CprAnal.hs b/compiler/GHC/Core/Opt/CprAnal.hs
index 25dc82d42f..0a35583acf 100644
--- a/compiler/GHC/Core/Opt/CprAnal.hs
+++ b/compiler/GHC/Core/Opt/CprAnal.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
-- | Constructed Product Result analysis. Identifies functions that surely
-- return heap-allocated records on every code path, so that we can eliminate
diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs
index 61aa9bfc46..1828f65276 100644
--- a/compiler/GHC/Core/Opt/DmdAnal.hs
+++ b/compiler/GHC/Core/Opt/DmdAnal.hs
@@ -7,7 +7,6 @@
-----------------
-}
-{-# LANGUAGE CPP #-}
module GHC.Core.Opt.DmdAnal
( DmdAnalOpts(..)
diff --git a/compiler/GHC/Core/Opt/FloatIn.hs b/compiler/GHC/Core/Opt/FloatIn.hs
index f1e9b044e8..6826e9da8f 100644
--- a/compiler/GHC/Core/Opt/FloatIn.hs
+++ b/compiler/GHC/Core/Opt/FloatIn.hs
@@ -12,7 +12,7 @@ case, so that we don't allocate things, save them on the stack, and
then discover that they aren't needed in the chosen branch.
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -fprof-auto #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/FloatOut.hs b/compiler/GHC/Core/Opt/FloatOut.hs
index b0c7db67c3..9f579a0a2e 100644
--- a/compiler/GHC/Core/Opt/FloatOut.hs
+++ b/compiler/GHC/Core/Opt/FloatOut.hs
@@ -6,7 +6,7 @@
``Long-distance'' floating of bindings towards the top level.
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Opt.FloatOut ( floatOutwards ) where
diff --git a/compiler/GHC/Core/Opt/LiberateCase.hs b/compiler/GHC/Core/Opt/LiberateCase.hs
index 6efae425f2..3c9eb5c3d0 100644
--- a/compiler/GHC/Core/Opt/LiberateCase.hs
+++ b/compiler/GHC/Core/Opt/LiberateCase.hs
@@ -4,7 +4,7 @@
\section[LiberateCase]{Unroll recursion to allow evals to be lifted from a loop}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Opt.LiberateCase ( liberateCase ) where
import GHC.Prelude
diff --git a/compiler/GHC/Core/Opt/Monad.hs b/compiler/GHC/Core/Opt/Monad.hs
index a8bf796af0..e8f1fb11e3 100644
--- a/compiler/GHC/Core/Opt/Monad.hs
+++ b/compiler/GHC/Core/Opt/Monad.hs
@@ -3,7 +3,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Core/Opt/OccurAnal.hs b/compiler/GHC/Core/Opt/OccurAnal.hs
index 034f44176f..a27ab91948 100644
--- a/compiler/GHC/Core/Opt/OccurAnal.hs
+++ b/compiler/GHC/Core/Opt/OccurAnal.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Core/Opt/SetLevels.hs b/compiler/GHC/Core/Opt/SetLevels.hs
index 9d96dd3586..ca74c65ef2 100644
--- a/compiler/GHC/Core/Opt/SetLevels.hs
+++ b/compiler/GHC/Core/Opt/SetLevels.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE PatternSynonyms #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs
index 3728b999ee..8b2f5b1274 100644
--- a/compiler/GHC/Core/Opt/Simplify.hs
+++ b/compiler/GHC/Core/Opt/Simplify.hs
@@ -4,7 +4,7 @@
\section[Simplify]{The main module of the simplifier}
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/Simplify/Env.hs b/compiler/GHC/Core/Opt/Simplify/Env.hs
index 6cc102ca23..6d325d02bb 100644
--- a/compiler/GHC/Core/Opt/Simplify/Env.hs
+++ b/compiler/GHC/Core/Opt/Simplify/Env.hs
@@ -4,7 +4,7 @@
\section[GHC.Core.Opt.Simplify.Monad]{The simplifier Monad}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Opt.Simplify.Env (
-- * The simplifier mode
diff --git a/compiler/GHC/Core/Opt/Simplify/Utils.hs b/compiler/GHC/Core/Opt/Simplify/Utils.hs
index 61c8133bc2..05dbe4149a 100644
--- a/compiler/GHC/Core/Opt/Simplify/Utils.hs
+++ b/compiler/GHC/Core/Opt/Simplify/Utils.hs
@@ -4,7 +4,7 @@
The simplifier utilities
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Opt.Simplify.Utils (
-- Rebuilding
diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs
index 58e77d76eb..3c0e6b46cf 100644
--- a/compiler/GHC/Core/Opt/SpecConstr.hs
+++ b/compiler/GHC/Core/Opt/SpecConstr.hs
@@ -10,7 +10,7 @@ ToDo [Oct 2013]
\section[SpecConstr]{Specialise over constructors}
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/Specialise.hs b/compiler/GHC/Core/Opt/Specialise.hs
index 7a7eb5a5a3..459e3fe43c 100644
--- a/compiler/GHC/Core/Opt/Specialise.hs
+++ b/compiler/GHC/Core/Opt/Specialise.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Core/Opt/StaticArgs.hs b/compiler/GHC/Core/Opt/StaticArgs.hs
index 00b84cdb2e..c514054ec1 100644
--- a/compiler/GHC/Core/Opt/StaticArgs.hs
+++ b/compiler/GHC/Core/Opt/StaticArgs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
diff --git a/compiler/GHC/Core/Opt/WorkWrap.hs b/compiler/GHC/Core/Opt/WorkWrap.hs
index 52c0b2259d..aa29daa9c9 100644
--- a/compiler/GHC/Core/Opt/WorkWrap.hs
+++ b/compiler/GHC/Core/Opt/WorkWrap.hs
@@ -4,7 +4,7 @@
\section[WorkWrap]{Worker/wrapper-generating back-end of strictness analyser}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.Opt.WorkWrap ( wwTopBinds ) where
import GHC.Prelude
diff --git a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
index 546fdd2fa2..16234d09fa 100644
--- a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
+++ b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
@@ -4,7 +4,7 @@
A library for the ``worker\/wrapper'' back-end to the strictness analyser
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ViewPatterns #-}
module GHC.Core.Opt.WorkWrap.Utils
diff --git a/compiler/GHC/Core/PatSyn.hs b/compiler/GHC/Core/PatSyn.hs
index 49bd8039d0..34a019dce1 100644
--- a/compiler/GHC/Core/PatSyn.hs
+++ b/compiler/GHC/Core/PatSyn.hs
@@ -5,7 +5,7 @@
\section[PatSyn]{@PatSyn@: Pattern synonyms}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.PatSyn (
-- * Main data types
diff --git a/compiler/GHC/Core/Rules.hs b/compiler/GHC/Core/Rules.hs
index 0b44b4f015..207e0b97a2 100644
--- a/compiler/GHC/Core/Rules.hs
+++ b/compiler/GHC/Core/Rules.hs
@@ -4,7 +4,6 @@
\section[CoreRules]{Rewrite rules}
-}
-{-# LANGUAGE CPP #-}
-- | Functions for collecting together and applying rewrite rules to a module.
-- The 'CoreRule' datatype itself is declared elsewhere.
@@ -857,13 +856,12 @@ match_co renv subst co1 co2
Just (arg2, res2)
-> match_cos renv subst [arg1, res1] [arg2, res2]
_ -> Nothing
-match_co _ _ _co1 _co2
+match_co _ _ co1 co2
-- Currently just deals with CoVarCo, TyConAppCo and Refl
-#if defined(DEBUG)
- = pprTrace "match_co: needs more cases" (ppr _co1 $$ ppr _co2) Nothing
-#else
+ | debugIsOn
+ = pprTrace "match_co: needs more cases" (ppr co1 $$ ppr co2) Nothing
+ | otherwise
= Nothing
-#endif
match_cos :: RuleMatchEnv
-> RuleSubst
diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs
index 9bc41b8dfc..ffec34ff17 100644
--- a/compiler/GHC/Core/SimpleOpt.hs
+++ b/compiler/GHC/Core/SimpleOpt.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MultiWayIf #-}
module GHC.Core.SimpleOpt (
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs
index 1d43387c72..06aa024f16 100644
--- a/compiler/GHC/Core/Subst.hs
+++ b/compiler/GHC/Core/Subst.hs
@@ -6,7 +6,7 @@
Utility functions on @Core@ syntax
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module GHC.Core.Subst (
-- * Main data types
diff --git a/compiler/GHC/Core/Tidy.hs b/compiler/GHC/Core/Tidy.hs
index eab1946051..933e8714c4 100644
--- a/compiler/GHC/Core/Tidy.hs
+++ b/compiler/GHC/Core/Tidy.hs
@@ -7,7 +7,7 @@ This module contains "tidying" code for *nested* expressions, bindings, rules.
The code for *top-level* bindings is in GHC.Iface.Tidy.
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module GHC.Core.Tidy (
tidyExpr, tidyRules, tidyUnfolding
diff --git a/compiler/GHC/Core/TyCo/FVs.hs b/compiler/GHC/Core/TyCo/FVs.hs
index 1c8dc4cadc..28929f37f9 100644
--- a/compiler/GHC/Core/TyCo/FVs.hs
+++ b/compiler/GHC/Core/TyCo/FVs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Core.TyCo.FVs
( shallowTyCoVarsOfType, shallowTyCoVarsOfTypes,
diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs
index 09bc9ab30d..513001e42d 100644
--- a/compiler/GHC/Core/TyCo/Rep.hs
+++ b/compiler/GHC/Core/TyCo/Rep.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_HADDOCK not-home #-}
diff --git a/compiler/GHC/Core/TyCo/Subst.hs b/compiler/GHC/Core/TyCo/Subst.hs
index 42c6ddac59..2b44fd2b94 100644
--- a/compiler/GHC/Core/TyCo/Subst.hs
+++ b/compiler/GHC/Core/TyCo/Subst.hs
@@ -4,7 +4,7 @@
Type and Coercion - friends' interface
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Core/TyCon.hs b/compiler/GHC/Core/TyCon.hs
index 2a6bc4df4e..07b583f92b 100644
--- a/compiler/GHC/Core/TyCon.hs
+++ b/compiler/GHC/Core/TyCon.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveDataTypeable #-}
diff --git a/compiler/GHC/Core/TyCon/Env.hs b/compiler/GHC/Core/TyCon/Env.hs
index bf2aaaf8c7..a891db9ea8 100644
--- a/compiler/GHC/Core/TyCon/Env.hs
+++ b/compiler/GHC/Core/TyCon/Env.hs
@@ -5,7 +5,7 @@
\section[TyConEnv]{@TyConEnv@: tyCon environments}
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Core/TyCon/RecWalk.hs b/compiler/GHC/Core/TyCon/RecWalk.hs
index a3c5c73cf4..a472cf65bb 100644
--- a/compiler/GHC/Core/TyCon/RecWalk.hs
+++ b/compiler/GHC/Core/TyCon/RecWalk.hs
@@ -6,7 +6,7 @@ Check for recursive type constructors.
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.TyCon.RecWalk (
diff --git a/compiler/GHC/Core/TyCon/Set.hs b/compiler/GHC/Core/TyCon/Set.hs
index 567c52b43c..bff8038671 100644
--- a/compiler/GHC/Core/TyCon/Set.hs
+++ b/compiler/GHC/Core/TyCon/Set.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Core.TyCon.Set (
-- * TyCons set type
diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs
index 40c1e22149..da3715406b 100644
--- a/compiler/GHC/Core/Type.hs
+++ b/compiler/GHC/Core/Type.hs
@@ -3,7 +3,7 @@
--
-- Type - public interface
-{-# LANGUAGE CPP, FlexibleContexts, PatternSynonyms, ViewPatterns, MultiWayIf #-}
+{-# LANGUAGE FlexibleContexts, PatternSynonyms, ViewPatterns, MultiWayIf #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index c4910e7974..e0f6943f31 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/compiler/GHC/Core/Unfold.hs
@@ -15,7 +15,7 @@ literal''). In the corner of a @CoreUnfolding@ unfolding, you will
find, unsurprisingly, a Core expression.
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Core/Unfold/Make.hs b/compiler/GHC/Core/Unfold/Make.hs
index 9cc5b030a0..84cd5168db 100644
--- a/compiler/GHC/Core/Unfold/Make.hs
+++ b/compiler/GHC/Core/Unfold/Make.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Unfolding creation
module GHC.Core.Unfold.Make
diff --git a/compiler/GHC/Core/Unify.hs b/compiler/GHC/Core/Unify.hs
index e7859f927b..fdf4d05068 100644
--- a/compiler/GHC/Core/Unify.hs
+++ b/compiler/GHC/Core/Unify.hs
@@ -1,7 +1,7 @@
-- (c) The University of Glasgow 2006
{-# LANGUAGE ScopedTypeVariables, PatternSynonyms #-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor, DeriveDataTypeable #-}
module GHC.Core.Unify (
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index b6273ed31d..2382cac7fb 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -6,8 +6,6 @@
Utility functions on @Core@ syntax
-}
-{-# LANGUAGE CPP #-}
-
-- | Commonly useful utilities for manipulating the Core language
module GHC.Core.Utils (
-- * Constructing expressions
@@ -1613,11 +1611,9 @@ expr_ok primop_ok other_expr
Var f -> app_ok primop_ok f args
-- 'LitRubbish' is the only literal that can occur in the head of an
-- application and will not be matched by the above case (Var /= Lit).
- Lit LitRubbish{} -> True
-#if defined(DEBUG)
- Lit _ -> pprPanic "Non-rubbish lit in app head" (ppr other_expr)
-#endif
- _ -> False
+ Lit LitRubbish{} -> True
+ Lit _ | debugIsOn -> pprPanic "Non-rubbish lit in app head" (ppr other_expr)
+ _ -> False
-----------------------------
app_ok :: (PrimOp -> Bool) -> Id -> [CoreExpr] -> Bool
diff --git a/compiler/GHC/CoreToIface.hs b/compiler/GHC/CoreToIface.hs
index a6fad7e90d..117020c5fc 100644
--- a/compiler/GHC/CoreToIface.hs
+++ b/compiler/GHC/CoreToIface.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE Strict #-} -- See Note [Avoiding space leaks in toIface*]
-- | Functions for converting Core things to interface file things.
diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs
index 7ad2bd0d74..3754bd4d0f 100644
--- a/compiler/GHC/CoreToStg.hs
+++ b/compiler/GHC/CoreToStg.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs
index 44af340770..fa20e39e70 100644
--- a/compiler/GHC/CoreToStg/Prep.hs
+++ b/compiler/GHC/CoreToStg/Prep.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Data/Bag.hs b/compiler/GHC/Data/Bag.hs
index 338b463832..e0e43d5ad1 100644
--- a/compiler/GHC/Data/Bag.hs
+++ b/compiler/GHC/Data/Bag.hs
@@ -6,7 +6,7 @@
Bag: an unordered collection with duplicates
-}
-{-# LANGUAGE ScopedTypeVariables, CPP, DeriveFunctor, TypeFamilies #-}
+{-# LANGUAGE ScopedTypeVariables, DeriveFunctor, TypeFamilies #-}
module GHC.Data.Bag (
Bag, -- abstract type
diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index ac44a68d54..655dd80005 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -1,7 +1,5 @@
--- (c) The University of Glasgow, 1997-2006
-
-{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
diff --git a/compiler/GHC/Data/Graph/Directed.hs b/compiler/GHC/Data/Graph/Directed.hs
index d6a9dba9a9..60d3393680 100644
--- a/compiler/GHC/Data/Graph/Directed.hs
+++ b/compiler/GHC/Data/Graph/Directed.hs
@@ -1,6 +1,6 @@
-- (c) The University of Glasgow 2006
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
diff --git a/compiler/GHC/Data/IOEnv.hs b/compiler/GHC/Data/IOEnv.hs
index 29cd831ecb..33cd0ed61e 100644
--- a/compiler/GHC/Data/IOEnv.hs
+++ b/compiler/GHC/Data/IOEnv.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE PatternSynonyms #-}
--
diff --git a/compiler/GHC/Data/List/SetOps.hs b/compiler/GHC/Data/List/SetOps.hs
index 32f373d17b..76e421c940 100644
--- a/compiler/GHC/Data/List/SetOps.hs
+++ b/compiler/GHC/Data/List/SetOps.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
-- | Set-like operations on lists
--
diff --git a/compiler/GHC/Data/Maybe.hs b/compiler/GHC/Data/Maybe.hs
index 9d47c8ccd8..3163829f75 100644
--- a/compiler/GHC/Data/Maybe.hs
+++ b/compiler/GHC/Data/Maybe.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE KindSignatures #-}
diff --git a/compiler/GHC/Data/Pair.hs b/compiler/GHC/Data/Pair.hs
index b0c6a59c3a..52c0fc211f 100644
--- a/compiler/GHC/Data/Pair.hs
+++ b/compiler/GHC/Data/Pair.hs
@@ -3,7 +3,7 @@ A simple homogeneous pair type with useful Functor, Applicative, and
Traversable instances.
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
module GHC.Data.Pair
diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs
index 873e7867c2..3d8048e825 100644
--- a/compiler/GHC/Driver/Backpack.hs
+++ b/compiler/GHC/Driver/Backpack.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE OverloadedStrings #-}
diff --git a/compiler/GHC/Driver/CmdLine.hs b/compiler/GHC/Driver/CmdLine.hs
index 56451ec199..b1226ecdca 100644
--- a/compiler/GHC/Driver/CmdLine.hs
+++ b/compiler/GHC/Driver/CmdLine.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
-------------------------------------------------------------------------------
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs
index 611cf498d3..4f80b6feda 100644
--- a/compiler/GHC/Driver/CodeOutput.hs
+++ b/compiler/GHC/Driver/CodeOutput.hs
@@ -4,7 +4,7 @@
\section{Code output phase}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Driver.CodeOutput
( codeOutput
diff --git a/compiler/GHC/Driver/Env.hs b/compiler/GHC/Driver/Env.hs
index 4fa77a8eb8..27e250b68c 100644
--- a/compiler/GHC/Driver/Env.hs
+++ b/compiler/GHC/Driver/Env.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Driver.Env
( Hsc(..)
diff --git a/compiler/GHC/Driver/Hooks.hs b/compiler/GHC/Driver/Hooks.hs
index 99c6ba8609..942c9810a5 100644
--- a/compiler/GHC/Driver/Hooks.hs
+++ b/compiler/GHC/Driver/Hooks.hs
@@ -3,7 +3,7 @@
-- NB: this module is SOURCE-imported by DynFlags, and should primarily
-- refer to *types*, rather than *code*
-{-# LANGUAGE CPP, RankNTypes, TypeFamilies #-}
+{-# LANGUAGE RankNTypes, TypeFamilies #-}
module GHC.Driver.Hooks
( Hooks
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index e9e203c06b..210c8644da 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE NondecreasingIndentation #-}
{-# OPTIONS_GHC -fprof-auto-top #-}
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 003bc6e0b0..f153e96e37 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE NondecreasingIndentation #-}
@@ -85,6 +84,7 @@ import GHC.Utils.Misc
import GHC.Utils.Error
import GHC.Utils.Logger
import GHC.Utils.TmpFs
+import GHC.Utils.Constants (isWindowsHost)
import GHC.Types.Basic
import GHC.Types.Error
@@ -743,14 +743,12 @@ guessOutputFile = modifySession $ \env ->
name = fmap dropExtension mainModuleSrcPath
name_exe = do
-#if defined(mingw32_HOST_OS)
-- we must add the .exe extension unconditionally here, otherwise
-- when name has an extension of its own, the .exe extension will
-- not be added by GHC.Driver.Pipeline.exeFileName. See #2248
- name' <- fmap (<.> "exe") name
-#else
- name' <- name
-#endif
+ name' <- if isWindowsHost --FIXME: should be the target platform
+ then fmap (<.> "exe") name
+ else name
mainModuleSrcPath' <- mainModuleSrcPath
-- #9930: don't clobber input files (unless they ask for it)
if name' == mainModuleSrcPath'
diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs
index c69e4538fb..890054efd4 100644
--- a/compiler/GHC/Driver/MakeFile.hs
+++ b/compiler/GHC/Driver/MakeFile.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/Driver/Monad.hs b/compiler/GHC/Driver/Monad.hs
index 2fa3c51cc1..873cbfac4e 100644
--- a/compiler/GHC/Driver/Monad.hs
+++ b/compiler/GHC/Driver/Monad.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, DeriveFunctor, DerivingVia, RankNTypes #-}
+{-# LANGUAGE DeriveFunctor, DerivingVia, RankNTypes #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
-- -----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/Driver/Phases.hs b/compiler/GHC/Driver/Phases.hs
index 4f9cbf83a1..07ec166ca3 100644
--- a/compiler/GHC/Driver/Phases.hs
+++ b/compiler/GHC/Driver/Phases.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index d9246ac0f9..02ebfbb5ce 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -1,5 +1,6 @@
-{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
+
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE NondecreasingIndentation #-}
diff --git a/compiler/GHC/Driver/Plugins.hs b/compiler/GHC/Driver/Plugins.hs
index 2d8bc0ad85..42cefd17fd 100644
--- a/compiler/GHC/Driver/Plugins.hs
+++ b/compiler/GHC/Driver/Plugins.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE CPP #-}
+
-- | Definitions for writing /plugins/ for GHC. Plugins can hook into
-- several areas of the compiler. See the 'Plugin' type. These plugins
diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs
index 9f7b278ef3..a4614bb220 100644
--- a/compiler/GHC/Hs/Decls.hs
+++ b/compiler/GHC/Hs/Decls.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/GHC/Hs/Doc.hs b/compiler/GHC/Hs/Doc.hs
index d0b9348676..117ce3adad 100644
--- a/compiler/GHC/Hs/Doc.hs
+++ b/compiler/GHC/Hs/Doc.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveDataTypeable #-}
module GHC.Hs.Doc
diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs
index c0a683746c..edab46a5b8 100644
--- a/compiler/GHC/Hs/Lit.hs
+++ b/compiler/GHC/Hs/Lit.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/GHC/Hs/Type.hs b/compiler/GHC/Hs/Type.hs
index 61f72eb782..b4553e2ec4 100644
--- a/compiler/GHC/Hs/Type.hs
+++ b/compiler/GHC/Hs/Type.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs
index 417f0b1a8a..68d6c9ca94 100644
--- a/compiler/GHC/Hs/Utils.hs
+++ b/compiler/GHC/Hs/Utils.hs
@@ -20,7 +20,7 @@ just attach noSrcSpan to everything.
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs
index d1315ee0a0..f2238aeffb 100644
--- a/compiler/GHC/HsToCore.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Arrows.hs b/compiler/GHC/HsToCore/Arrows.hs
index 2c57baeb3e..0f7f261341 100644
--- a/compiler/GHC/HsToCore/Arrows.hs
+++ b/compiler/GHC/HsToCore/Arrows.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs
index a4f182f036..db5bb68706 100644
--- a/compiler/GHC/HsToCore/Binds.hs
+++ b/compiler/GHC/HsToCore/Binds.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs
index 686d4ee7ef..4fb61136a2 100644
--- a/compiler/GHC/HsToCore/Expr.hs
+++ b/compiler/GHC/HsToCore/Expr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Foreign/Call.hs b/compiler/GHC/HsToCore/Foreign/Call.hs
index 52d7918fc5..ed8853eb71 100644
--- a/compiler/GHC/HsToCore/Foreign/Call.hs
+++ b/compiler/GHC/HsToCore/Foreign/Call.hs
@@ -6,7 +6,7 @@
Desugaring foreign calls
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Foreign/Decl.hs b/compiler/GHC/HsToCore/Foreign/Decl.hs
index 4dcefc427d..0b0d1dc21d 100644
--- a/compiler/GHC/HsToCore/Foreign/Decl.hs
+++ b/compiler/GHC/HsToCore/Foreign/Decl.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/HsToCore/GuardedRHSs.hs b/compiler/GHC/HsToCore/GuardedRHSs.hs
index b74d329417..6f1de8ae16 100644
--- a/compiler/GHC/HsToCore/GuardedRHSs.hs
+++ b/compiler/GHC/HsToCore/GuardedRHSs.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-
(c) The University of Glasgow 2006
diff --git a/compiler/GHC/HsToCore/ListComp.hs b/compiler/GHC/HsToCore/ListComp.hs
index d716dcc3ff..fb338208fc 100644
--- a/compiler/GHC/HsToCore/ListComp.hs
+++ b/compiler/GHC/HsToCore/ListComp.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-
diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs
index c5caf1a9a4..38d9c2101d 100644
--- a/compiler/GHC/HsToCore/Match.hs
+++ b/compiler/GHC/HsToCore/Match.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/HsToCore/Match/Constructor.hs b/compiler/GHC/HsToCore/Match/Constructor.hs
index f7cbc9238d..526614d933 100644
--- a/compiler/GHC/HsToCore/Match/Constructor.hs
+++ b/compiler/GHC/HsToCore/Match/Constructor.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs
index d34549d0d3..245b289ffd 100644
--- a/compiler/GHC/HsToCore/Match/Literal.hs
+++ b/compiler/GHC/HsToCore/Match/Literal.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE TypeApplications #-}
diff --git a/compiler/GHC/HsToCore/Pmc.hs b/compiler/GHC/HsToCore/Pmc.hs
index 2563e4af05..a9e97ef781 100644
--- a/compiler/GHC/HsToCore/Pmc.hs
+++ b/compiler/GHC/HsToCore/Pmc.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Check.hs b/compiler/GHC/HsToCore/Pmc/Check.hs
index 772877d3e8..a89f4e2643 100644
--- a/compiler/GHC/HsToCore/Pmc/Check.hs
+++ b/compiler/GHC/HsToCore/Pmc/Check.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Desugar.hs b/compiler/GHC/HsToCore/Pmc/Desugar.hs
index 5b0662cdd3..4c9e043c25 100644
--- a/compiler/GHC/HsToCore/Pmc/Desugar.hs
+++ b/compiler/GHC/HsToCore/Pmc/Desugar.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Ppr.hs b/compiler/GHC/HsToCore/Pmc/Ppr.hs
index e8a5182bf9..eddab8df6e 100644
--- a/compiler/GHC/HsToCore/Pmc/Ppr.hs
+++ b/compiler/GHC/HsToCore/Pmc/Ppr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Solver.hs b/compiler/GHC/HsToCore/Pmc/Solver.hs
index 4880a627e4..65bf188bf4 100644
--- a/compiler/GHC/HsToCore/Pmc/Solver.hs
+++ b/compiler/GHC/HsToCore/Pmc/Solver.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Solver/Types.hs b/compiler/GHC/HsToCore/Pmc/Solver/Types.hs
index 17edf6fb77..be977476df 100644
--- a/compiler/GHC/HsToCore/Pmc/Solver/Types.hs
+++ b/compiler/GHC/HsToCore/Pmc/Solver/Types.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE ApplicativeDo #-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
-- | Domain types used in "GHC.HsToCore.Pmc.Solver".
diff --git a/compiler/GHC/HsToCore/Pmc/Types.hs b/compiler/GHC/HsToCore/Pmc/Types.hs
index b33602eb4a..d3046e5812 100644
--- a/compiler/GHC/HsToCore/Pmc/Types.hs
+++ b/compiler/GHC/HsToCore/Pmc/Types.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
diff --git a/compiler/GHC/HsToCore/Pmc/Utils.hs b/compiler/GHC/HsToCore/Pmc/Utils.hs
index 013006f8c3..bf240317e4 100644
--- a/compiler/GHC/HsToCore/Pmc/Utils.hs
+++ b/compiler/GHC/HsToCore/Pmc/Utils.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
-- | Utility module for the pattern-match coverage checker.
diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs
index ad6ec602b4..b911eea798 100644
--- a/compiler/GHC/HsToCore/Quote.hs
+++ b/compiler/GHC/HsToCore/Quote.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
diff --git a/compiler/GHC/HsToCore/Usage.hs b/compiler/GHC/HsToCore/Usage.hs
index ce1a32950c..139ec05167 100644
--- a/compiler/GHC/HsToCore/Usage.hs
+++ b/compiler/GHC/HsToCore/Usage.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs
index 4787bb3844..bc4787bbfb 100644
--- a/compiler/GHC/HsToCore/Utils.hs
+++ b/compiler/GHC/HsToCore/Utils.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Iface/Binary.hs b/compiler/GHC/Iface/Binary.hs
index 7a732cd48b..b248158ef8 100644
--- a/compiler/GHC/Iface/Binary.hs
+++ b/compiler/GHC/Iface/Binary.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BinaryLiterals, CPP, ScopedTypeVariables, BangPatterns #-}
+{-# LANGUAGE BinaryLiterals, ScopedTypeVariables, BangPatterns #-}
--
-- (c) The University of Glasgow 2002-2006
diff --git a/compiler/GHC/Iface/Env.hs b/compiler/GHC/Iface/Env.hs
index b79264e22b..adcf62f8c5 100644
--- a/compiler/GHC/Iface/Env.hs
+++ b/compiler/GHC/Iface/Env.hs
@@ -1,6 +1,6 @@
-- (c) The University of Glasgow 2002-2006
-{-# LANGUAGE CPP, RankNTypes #-}
+{-# LANGUAGE RankNTypes #-}
module GHC.Iface.Env (
newGlobalBinder, newInteractiveBinder,
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs
index 41fe389b46..7b2a659161 100644
--- a/compiler/GHC/Iface/Load.hs
+++ b/compiler/GHC/Iface/Load.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP, BangPatterns, NondecreasingIndentation #-}
+{-# LANGUAGE BangPatterns, NondecreasingIndentation #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/GHC/Iface/Make.hs b/compiler/GHC/Iface/Make.hs
index 9fc9fca257..416cd56d9e 100644
--- a/compiler/GHC/Iface/Make.hs
+++ b/compiler/GHC/Iface/Make.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE NondecreasingIndentation #-}
{-
diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs
index ede395aa67..e033a6628a 100644
--- a/compiler/GHC/Iface/Recomp.hs
+++ b/compiler/GHC/Iface/Recomp.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiWayIf #-}
-- | Module for detecting if recompilation is required
@@ -41,6 +40,7 @@ import GHC.Utils.Binary
import GHC.Utils.Fingerprint
import GHC.Utils.Exception
import GHC.Utils.Logger
+import GHC.Utils.Constants (debugIsOn)
import GHC.Types.Annotations
import GHC.Types.Name
@@ -664,12 +664,9 @@ checkModUsage _this_pkg UsageFile{ usg_file_path = file,
else return UpToDate
where
recomp = RecompBecause (file ++ " changed")
- handler =
-#if defined(DEBUG)
- \e -> pprTrace "UsageFile" (text (show e)) $ return recomp
-#else
- \_ -> return recomp -- if we can't find the file, just recompile, don't fail
-#endif
+ handler = if debugIsOn
+ then \e -> pprTrace "UsageFile" (text (show e)) $ return recomp
+ else \_ -> return recomp -- if we can't find the file, just recompile, don't fail
------------------------
checkModuleFingerprint
diff --git a/compiler/GHC/Iface/Recomp/Binary.hs b/compiler/GHC/Iface/Recomp/Binary.hs
index c4e1d65a17..8fd9ef858f 100644
--- a/compiler/GHC/Iface/Recomp/Binary.hs
+++ b/compiler/GHC/Iface/Recomp/Binary.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Computing fingerprints of values serializeable with GHC's \"Binary\" module.
module GHC.Iface.Recomp.Binary
diff --git a/compiler/GHC/Iface/Rename.hs b/compiler/GHC/Iface/Rename.hs
index edc166acf3..18ad1a55ce 100644
--- a/compiler/GHC/Iface/Rename.hs
+++ b/compiler/GHC/Iface/Rename.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Iface/Syntax.hs b/compiler/GHC/Iface/Syntax.hs
index 483a18465a..198b5eb5f4 100644
--- a/compiler/GHC/Iface/Syntax.hs
+++ b/compiler/GHC/Iface/Syntax.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
module GHC.Iface.Syntax (
diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs
index 418e878ea5..71e93671b9 100644
--- a/compiler/GHC/Iface/Tidy.hs
+++ b/compiler/GHC/Iface/Tidy.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs
index f1326b3461..3477fcf552 100644
--- a/compiler/GHC/Iface/Type.hs
+++ b/compiler/GHC/Iface/Type.hs
@@ -6,7 +6,7 @@
This module defines interface types and binders
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleInstances #-}
-- FlexibleInstances for Binary (DefMethSpec IfaceType)
{-# LANGUAGE BangPatterns #-}
diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs
index 1f5d7e3d58..66a143b0b4 100644
--- a/compiler/GHC/IfaceToCore.hs
+++ b/compiler/GHC/IfaceToCore.hs
@@ -6,7 +6,7 @@
Type checking of type signatures in interface files
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE NondecreasingIndentation #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs
index b026536937..1258034fb5 100644
--- a/compiler/GHC/Linker/Loader.hs
+++ b/compiler/GHC/Linker/Loader.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, TupleSections, RecordWildCards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections, RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
--
diff --git a/compiler/GHC/Llvm/Ppr.hs b/compiler/GHC/Llvm/Ppr.hs
index 0bf4e53d60..26c6bf5862 100644
--- a/compiler/GHC/Llvm/Ppr.hs
+++ b/compiler/GHC/Llvm/Ppr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
--------------------------------------------------------------------------------
diff --git a/compiler/GHC/Llvm/Types.hs b/compiler/GHC/Llvm/Types.hs
index 8b568d3d1f..a62f0857fa 100644
--- a/compiler/GHC/Llvm/Types.hs
+++ b/compiler/GHC/Llvm/Types.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
--------------------------------------------------------------------------------
diff --git a/compiler/GHC/Parser/CharClass.hs b/compiler/GHC/Parser/CharClass.hs
index e287508dab..8a204b463d 100644
--- a/compiler/GHC/Parser/CharClass.hs
+++ b/compiler/GHC/Parser/CharClass.hs
@@ -1,5 +1,5 @@
-- Character classification
-{-# LANGUAGE CPP #-}
+
module GHC.Parser.CharClass
( is_ident -- Char# -> Bool
, is_symbol -- Char# -> Bool
diff --git a/compiler/GHC/Parser/Header.hs b/compiler/GHC/Parser/Header.hs
index 7fada7a704..bb0aee09be 100644
--- a/compiler/GHC/Parser/Header.hs
+++ b/compiler/GHC/Parser/Header.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index 34e1a8401a..beeaeb9d9e 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
diff --git a/compiler/GHC/Rename/Env.hs b/compiler/GHC/Rename/Env.hs
index 9a4f22979e..090810512f 100644
--- a/compiler/GHC/Rename/Env.hs
+++ b/compiler/GHC/Rename/Env.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeApplications #-}
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs
index e1b68e2504..e4b4b10363 100644
--- a/compiler/GHC/Rename/Expr.hs
+++ b/compiler/GHC/Rename/Expr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiWayIf #-}
diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs
index 268e6418cf..a598deeca0 100644
--- a/compiler/GHC/Rename/HsType.hs
+++ b/compiler/GHC/Rename/HsType.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs
index 0e536b7461..8bb8557186 100644
--- a/compiler/GHC/Rename/Module.hs
+++ b/compiler/GHC/Rename/Module.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs
index f4bde99be0..b747f73987 100644
--- a/compiler/GHC/Rename/Names.hs
+++ b/compiler/GHC/Rename/Names.hs
@@ -4,7 +4,7 @@
Extracting imported and top-level names in scope
-}
-{-# LANGUAGE CPP, NondecreasingIndentation #-}
+{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs
index 0d14420be4..c86e3f6ec2 100644
--- a/compiler/GHC/Rename/Pat.hs
+++ b/compiler/GHC/Rename/Pat.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE TypeApplications #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs
index 4027c89e79..98e8cb2899 100644
--- a/compiler/GHC/Rename/Splice.hs
+++ b/compiler/GHC/Rename/Splice.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs
index 217df11ffb..97c26099d4 100644
--- a/compiler/GHC/Runtime/Eval.hs
+++ b/compiler/GHC/Runtime/Eval.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs
index 5c00d21ed1..10f22b5a3e 100644
--- a/compiler/GHC/Runtime/Heap/Inspect.hs
+++ b/compiler/GHC/Runtime/Heap/Inspect.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables, MagicHash #-}
+{-# LANGUAGE BangPatterns, ScopedTypeVariables, MagicHash #-}
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/Runtime/Heap/Layout.hs b/compiler/GHC/Runtime/Heap/Layout.hs
index b81b3adc64..51f209f6b6 100644
--- a/compiler/GHC/Runtime/Heap/Layout.hs
+++ b/compiler/GHC/Runtime/Heap/Layout.hs
@@ -3,7 +3,8 @@
--
-- Storage manager representation of closures
-{-# LANGUAGE CPP,GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module GHC.Runtime.Heap.Layout (
-- * Words and bytes
diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs
index 0bd9f1a0c5..7dcc5fcd82 100644
--- a/compiler/GHC/Runtime/Interpreter.hs
+++ b/compiler/GHC/Runtime/Interpreter.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
diff --git a/compiler/GHC/Runtime/Loader.hs b/compiler/GHC/Runtime/Loader.hs
index b0a3c2aded..6c590b5790 100644
--- a/compiler/GHC/Runtime/Loader.hs
+++ b/compiler/GHC/Runtime/Loader.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Dynamically lookup up values from modules and loading them.
module GHC.Runtime.Loader (
diff --git a/compiler/GHC/Settings.hs b/compiler/GHC/Settings.hs
index 13b7fd05c2..c7c98e1755 100644
--- a/compiler/GHC/Settings.hs
+++ b/compiler/GHC/Settings.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Run-time settings
module GHC.Settings
diff --git a/compiler/GHC/Settings/IO.hs b/compiler/GHC/Settings/IO.hs
index dd6f5a8c1d..a6af6ae58c 100644
--- a/compiler/GHC/Settings/IO.hs
+++ b/compiler/GHC/Settings/IO.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Stg/DepAnal.hs b/compiler/GHC/Stg/DepAnal.hs
index 0e53ffcca1..74b490969a 100644
--- a/compiler/GHC/Stg/DepAnal.hs
+++ b/compiler/GHC/Stg/DepAnal.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Stg.DepAnal (depSortStgPgm) where
diff --git a/compiler/GHC/Stg/Lift.hs b/compiler/GHC/Stg/Lift.hs
index 5527f37165..f83ccd388f 100644
--- a/compiler/GHC/Stg/Lift.hs
+++ b/compiler/GHC/Stg/Lift.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | Implements a selective lambda lifter, running late in the optimisation
-- pipeline.
diff --git a/compiler/GHC/Stg/Lift/Monad.hs b/compiler/GHC/Stg/Lift/Monad.hs
index 0671bd537e..9b29b02ba6 100644
--- a/compiler/GHC/Stg/Lift/Monad.hs
+++ b/compiler/GHC/Stg/Lift/Monad.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs
index 8c57ad7577..1801b28692 100644
--- a/compiler/GHC/Stg/Pipeline.hs
+++ b/compiler/GHC/Stg/Pipeline.hs
@@ -4,7 +4,7 @@
\section[SimplStg]{Driver for simplifying @STG@ programs}
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Stg/Stats.hs b/compiler/GHC/Stg/Stats.hs
index 485ddbf055..a4d36136bf 100644
--- a/compiler/GHC/Stg/Stats.hs
+++ b/compiler/GHC/Stg/Stats.hs
@@ -21,7 +21,7 @@ The program gather statistics about
\end{enumerate}
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Stg.Stats ( showStgStats ) where
diff --git a/compiler/GHC/Stg/Subst.hs b/compiler/GHC/Stg/Subst.hs
index c5aa65c7f1..2ff09709a9 100644
--- a/compiler/GHC/Stg/Subst.hs
+++ b/compiler/GHC/Stg/Subst.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Stg.Subst where
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs
index 6728a3fc87..a1a1084166 100644
--- a/compiler/GHC/Stg/Syntax.hs
+++ b/compiler/GHC/Stg/Syntax.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
diff --git a/compiler/GHC/Stg/Unarise.hs b/compiler/GHC/Stg/Unarise.hs
index 014d3807a1..6b41063f9b 100644
--- a/compiler/GHC/Stg/Unarise.hs
+++ b/compiler/GHC/Stg/Unarise.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TupleSections #-}
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs
index 1849480934..e2f48390e5 100644
--- a/compiler/GHC/StgToByteCode.hs
+++ b/compiler/GHC/StgToByteCode.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards #-}
diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs
index 20bde7c3bd..f8fe4f71d8 100644
--- a/compiler/GHC/StgToCmm.hs
+++ b/compiler/GHC/StgToCmm.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs
index bbfcdd9811..c2a936f33a 100644
--- a/compiler/GHC/StgToCmm/Closure.hs
+++ b/compiler/GHC/StgToCmm/Closure.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
diff --git a/compiler/GHC/StgToCmm/DataCon.hs b/compiler/GHC/StgToCmm/DataCon.hs
index 282d9116bf..2805aceb91 100644
--- a/compiler/GHC/StgToCmm/DataCon.hs
+++ b/compiler/GHC/StgToCmm/DataCon.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs
index 5d8e2ecfaa..f28f0d0ec2 100644
--- a/compiler/GHC/StgToCmm/Env.hs
+++ b/compiler/GHC/StgToCmm/Env.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs
index c777c2b406..6355b55427 100644
--- a/compiler/GHC/StgToCmm/Expr.hs
+++ b/compiler/GHC/StgToCmm/Expr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, BangPatterns #-}
+{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/StgToCmm/Lit.hs b/compiler/GHC/StgToCmm/Lit.hs
index 6a7c37258b..8e2e000753 100644
--- a/compiler/GHC/StgToCmm/Lit.hs
+++ b/compiler/GHC/StgToCmm/Lit.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, LambdaCase #-}
+{-# LANGUAGE LambdaCase #-}
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs
index a004411d89..a8dec42c9b 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/StgToCmm/Types.hs b/compiler/GHC/StgToCmm/Types.hs
index 5428430093..fa6a663038 100644
--- a/compiler/GHC/StgToCmm/Types.hs
+++ b/compiler/GHC/StgToCmm/Types.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.StgToCmm.Types
( CgInfos (..)
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index bd5d578188..a1b13e2e8d 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
diff --git a/compiler/GHC/SysTools.hs b/compiler/GHC/SysTools.hs
index ebaa74793c..36f924bf90 100644
--- a/compiler/GHC/SysTools.hs
+++ b/compiler/GHC/SysTools.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
{-
diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs
index 198ad6596f..daed11f432 100644
--- a/compiler/GHC/SysTools/Ar.hs
+++ b/compiler/GHC/SysTools/Ar.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-}
{- Note: [The need for Ar.hs]
Building `-staticlib` required the presence of libtool, and was a such
restricted to mach-o only. As libtool on macOS and gnu libtool are very
diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
index a3bde302bc..ce286fe8ca 100644
--- a/compiler/GHC/SysTools/Tasks.hs
+++ b/compiler/GHC/SysTools/Tasks.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
--
-- Tasks running external programs for SysTools
@@ -27,6 +27,7 @@ import GHC.Utils.Outputable
import GHC.Utils.Misc
import GHC.Utils.Logger
import GHC.Utils.TmpFs
+import GHC.Utils.Constants (isWindowsHost)
import Data.List (tails, isPrefixOf)
import System.IO
@@ -308,23 +309,19 @@ ld: warning: symbol referencing errors
-- See Note [Merging object files for GHCi] in GHC.Driver.Pipeline.
runMergeObjects :: Logger -> TmpFs -> DynFlags -> [Option] -> IO ()
-#if defined(mingw32_HOST_OS)
-runMergeObjects logger tmpfs dflags args =
-#else
-runMergeObjects logger _tmpfs dflags args =
-#endif
+runMergeObjects logger tmpfs dflags args =
traceToolCommand logger dflags "merge-objects" $ do
let (p,args0) = pgm_lm dflags
optl_args = map Option (getOpts dflags opt_lm)
args2 = args0 ++ args ++ optl_args
-- N.B. Darwin's ld64 doesn't support response files. Consequently we only
-- use them on Windows where they are truly necessary.
-#if defined(mingw32_HOST_OS)
- mb_env <- getGccEnv args2
- runSomethingResponseFile logger tmpfs dflags id "Merge objects" p args2 mb_env
-#else
- runSomething logger dflags "Merge objects" p args2
-#endif
+ if isWindowsHost
+ then do
+ mb_env <- getGccEnv args2
+ runSomethingResponseFile logger tmpfs dflags id "Merge objects" p args2 mb_env
+ else do
+ runSomething logger dflags "Merge objects" p args2
runLibtool :: Logger -> DynFlags -> [Option] -> IO ()
runLibtool logger dflags args = traceToolCommand logger dflags "libtool" $ do
diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs
index ded92fde1e..8b7a437e79 100644
--- a/compiler/GHC/Tc/Deriv.hs
+++ b/compiler/GHC/Tc/Deriv.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Deriv/Functor.hs b/compiler/GHC/Tc/Deriv/Functor.hs
index d9aa90d6b2..4137c0e88f 100644
--- a/compiler/GHC/Tc/Deriv/Functor.hs
+++ b/compiler/GHC/Tc/Deriv/Functor.hs
@@ -3,7 +3,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/GHC/Tc/Deriv/Generate.hs b/compiler/GHC/Tc/Deriv/Generate.hs
index 465651a2ef..806c00e63e 100644
--- a/compiler/GHC/Tc/Deriv/Generate.hs
+++ b/compiler/GHC/Tc/Deriv/Generate.hs
@@ -5,7 +5,7 @@
-}
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
diff --git a/compiler/GHC/Tc/Deriv/Generics.hs b/compiler/GHC/Tc/Deriv/Generics.hs
index d2acbd515a..4aeac0ceae 100644
--- a/compiler/GHC/Tc/Deriv/Generics.hs
+++ b/compiler/GHC/Tc/Deriv/Generics.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Deriv/Infer.hs b/compiler/GHC/Tc/Deriv/Infer.hs
index b09070e653..fef3cfa670 100644
--- a/compiler/GHC/Tc/Deriv/Infer.hs
+++ b/compiler/GHC/Tc/Deriv/Infer.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MultiWayIf #-}
-- | Functions for inferring (and simplifying) the context for derived instances.
diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs
index e4a9abb3ee..767a7d22b2 100644
--- a/compiler/GHC/Tc/Errors.hs
+++ b/compiler/GHC/Tc/Errors.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs
index d6b09d6692..a823861cd7 100644
--- a/compiler/GHC/Tc/Errors/Hole.hs
+++ b/compiler/GHC/Tc/Errors/Hole.hs
@@ -1,7 +1,9 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ExistentialQuantification #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
+
module GHC.Tc.Errors.Hole
( findValidHoleFits
diff --git a/compiler/GHC/Tc/Gen/App.hs b/compiler/GHC/Tc/Gen/App.hs
index 53f13cc645..76fdb7c5f5 100644
--- a/compiler/GHC/Tc/Gen/App.hs
+++ b/compiler/GHC/Tc/Gen/App.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs
index 135cc67f3b..a92a4320c7 100644
--- a/compiler/GHC/Tc/Gen/Bind.hs
+++ b/compiler/GHC/Tc/Gen/Bind.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs
index c9d18bca27..5bbf35d462 100644
--- a/compiler/GHC/Tc/Gen/Expr.hs
+++ b/compiler/GHC/Tc/Gen/Expr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs
index 892cb6764e..ab7188fa97 100644
--- a/compiler/GHC/Tc/Gen/Foreign.hs
+++ b/compiler/GHC/Tc/Gen/Foreign.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Tc/Gen/Head.hs b/compiler/GHC/Tc/Gen/Head.hs
index a03f941168..1f0fce7f4e 100644
--- a/compiler/GHC/Tc/Gen/Head.hs
+++ b/compiler/GHC/Tc/Gen/Head.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs
index 297df294d3..75cece7b2d 100644
--- a/compiler/GHC/Tc/Gen/HsType.hs
+++ b/compiler/GHC/Tc/Gen/HsType.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
diff --git a/compiler/GHC/Tc/Gen/Match.hs b/compiler/GHC/Tc/Gen/Match.hs
index 0605767a47..ece6c47420 100644
--- a/compiler/GHC/Tc/Gen/Match.hs
+++ b/compiler/GHC/Tc/Gen/Match.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs
index 892aef0a0b..f836d809f3 100644
--- a/compiler/GHC/Tc/Gen/Pat.hs
+++ b/compiler/GHC/Tc/Gen/Pat.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TupleSections #-}
diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs
index 54108bfaa1..3319c2699f 100644
--- a/compiler/GHC/Tc/Gen/Sig.hs
+++ b/compiler/GHC/Tc/Gen/Sig.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
module GHC.Tc.Gen.Sig(
diff --git a/compiler/GHC/Tc/Gen/Splice.hs-boot b/compiler/GHC/Tc/Gen/Splice.hs-boot
index ef9d210e9c..54dd1d0251 100644
--- a/compiler/GHC/Tc/Gen/Splice.hs-boot
+++ b/compiler/GHC/Tc/Gen/Splice.hs-boot
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
module GHC.Tc.Gen.Splice where
diff --git a/compiler/GHC/Tc/Instance/Class.hs b/compiler/GHC/Tc/Instance/Class.hs
index 9ba131873b..af13a31272 100644
--- a/compiler/GHC/Tc/Instance/Class.hs
+++ b/compiler/GHC/Tc/Instance/Class.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Tc/Instance/Family.hs b/compiler/GHC/Tc/Instance/Family.hs
index 8e4181d969..015ae301cf 100644
--- a/compiler/GHC/Tc/Instance/Family.hs
+++ b/compiler/GHC/Tc/Instance/Family.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, GADTs, ViewPatterns #-}
+{-# LANGUAGE GADTs, ViewPatterns #-}
-- | The @FamInst@ type: family instance heads
module GHC.Tc.Instance.Family (
diff --git a/compiler/GHC/Tc/Instance/FunDeps.hs b/compiler/GHC/Tc/Instance/FunDeps.hs
index f5b5b7b4eb..8a54e03b7e 100644
--- a/compiler/GHC/Tc/Instance/FunDeps.hs
+++ b/compiler/GHC/Tc/Instance/FunDeps.hs
@@ -5,7 +5,7 @@
-}
-{-# LANGUAGE CPP #-}
+
-- | Functional dependencies
--
diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs
index 193ee75009..c187cbf6ce 100644
--- a/compiler/GHC/Tc/Instance/Typeable.hs
+++ b/compiler/GHC/Tc/Instance/Typeable.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1999
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Plugin.hs b/compiler/GHC/Tc/Plugin.hs
index b4d4fc5ad2..fd5d21751e 100644
--- a/compiler/GHC/Tc/Plugin.hs
+++ b/compiler/GHC/Tc/Plugin.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
-- | This module provides an interface for typechecker plugins to
-- access select functions of the 'TcM', principally those to do with
-- reading parts of the state.
diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs
index 31d6eabe41..e6212ef648 100644
--- a/compiler/GHC/Tc/Solver.hs
+++ b/compiler/GHC/Tc/Solver.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Tc.Solver(
InferMode(..), simplifyInfer, findInferredDiff,
diff --git a/compiler/GHC/Tc/Solver/Interact.hs b/compiler/GHC/Tc/Solver/Interact.hs
index b28e88412c..efa03834dd 100644
--- a/compiler/GHC/Tc/Solver/Interact.hs
+++ b/compiler/GHC/Tc/Solver/Interact.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Tc/Solver/Rewrite.hs b/compiler/GHC/Tc/Solver/Rewrite.hs
index b9e6a997bb..9c0d39ec46 100644
--- a/compiler/GHC/Tc/Solver/Rewrite.hs
+++ b/compiler/GHC/Tc/Solver/Rewrite.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs
index 6f41870632..d0a511ccfa 100644
--- a/compiler/GHC/Tc/TyCl.hs
+++ b/compiler/GHC/Tc/TyCl.hs
@@ -4,7 +4,8 @@
-}
-{-# LANGUAGE CPP, TupleSections, ScopedTypeVariables, MultiWayIf #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections, ScopedTypeVariables, MultiWayIf #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE LambdaCase #-}
diff --git a/compiler/GHC/Tc/TyCl/Build.hs b/compiler/GHC/Tc/TyCl/Build.hs
index 8c370ce87c..2d0309db54 100644
--- a/compiler/GHC/Tc/TyCl/Build.hs
+++ b/compiler/GHC/Tc/TyCl/Build.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Tc/TyCl/Class.hs b/compiler/GHC/Tc/TyCl/Class.hs
index 05565c8467..cd70be7c59 100644
--- a/compiler/GHC/Tc/TyCl/Class.hs
+++ b/compiler/GHC/Tc/TyCl/Class.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs
index 5bd1521113..8177f145e6 100644
--- a/compiler/GHC/Tc/TyCl/Instance.hs
+++ b/compiler/GHC/Tc/TyCl/Instance.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/TyCl/Utils.hs b/compiler/GHC/Tc/TyCl/Utils.hs
index 4c47d6d706..79ed91ba30 100644
--- a/compiler/GHC/Tc/TyCl/Utils.hs
+++ b/compiler/GHC/Tc/TyCl/Utils.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs
index dcaa4509e5..0145ee9b43 100644
--- a/compiler/GHC/Tc/Types.hs
+++ b/compiler/GHC/Tc/Types.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
diff --git a/compiler/GHC/Tc/Types/Constraint.hs b/compiler/GHC/Tc/Types/Constraint.hs
index 76a51f0f5e..ea4b1b2b86 100644
--- a/compiler/GHC/Tc/Types/Constraint.hs
+++ b/compiler/GHC/Tc/Types/Constraint.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Tc/Types/Evidence.hs b/compiler/GHC/Tc/Types/Evidence.hs
index e851797f7a..d173fc0a23 100644
--- a/compiler/GHC/Tc/Types/Evidence.hs
+++ b/compiler/GHC/Tc/Types/Evidence.hs
@@ -1,6 +1,6 @@
-- (c) The University of Glasgow 2006
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE LambdaCase #-}
module GHC.Tc.Types.Evidence (
diff --git a/compiler/GHC/Tc/Types/Origin.hs b/compiler/GHC/Tc/Types/Origin.hs
index a8263d4c2d..0f5d74e27e 100644
--- a/compiler/GHC/Tc/Types/Origin.hs
+++ b/compiler/GHC/Tc/Types/Origin.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Tc/Utils/Backpack.hs b/compiler/GHC/Tc/Utils/Backpack.hs
index ef2f4e3cb5..837ab3d2a7 100644
--- a/compiler/GHC/Tc/Utils/Backpack.hs
+++ b/compiler/GHC/Tc/Utils/Backpack.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE NondecreasingIndentation #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs
index 7c809a752d..cfcd53489b 100644
--- a/compiler/GHC/Tc/Utils/Env.hs
+++ b/compiler/GHC/Tc/Utils/Env.hs
@@ -1,5 +1,5 @@
-- (c) The University of Glasgow 2006
-{-# LANGUAGE CPP, FlexibleInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} -- instance MonadThings is necessarily an
-- orphan
diff --git a/compiler/GHC/Tc/Utils/Instantiate.hs b/compiler/GHC/Tc/Utils/Instantiate.hs
index e3dcd8c5fd..68839981ca 100644
--- a/compiler/GHC/Tc/Utils/Instantiate.hs
+++ b/compiler/GHC/Tc/Utils/Instantiate.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs
index 46dd001960..f1a5425b6f 100644
--- a/compiler/GHC/Tc/Utils/Monad.hs
+++ b/compiler/GHC/Tc/Utils/Monad.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs
index 360ffbc8ba..f24f949923 100644
--- a/compiler/GHC/Tc/Utils/TcMType.hs
+++ b/compiler/GHC/Tc/Utils/TcMType.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE TupleSections #-}
@@ -337,15 +337,13 @@ newCoercionHole pred_ty
-- | Put a value in a coercion hole
fillCoercionHole :: CoercionHole -> Coercion -> TcM ()
-fillCoercionHole (CoercionHole { ch_ref = ref, ch_co_var = cv }) co
- = do {
-#if defined(DEBUG)
- ; cts <- readTcRef ref
- ; whenIsJust cts $ \old_co ->
- pprPanic "Filling a filled coercion hole" (ppr cv $$ ppr co $$ ppr old_co)
-#endif
- ; traceTc "Filling coercion hole" (ppr cv <+> text ":=" <+> ppr co)
- ; writeTcRef ref (Just co) }
+fillCoercionHole (CoercionHole { ch_ref = ref, ch_co_var = cv }) co = do
+ when debugIsOn $ do
+ cts <- readTcRef ref
+ whenIsJust cts $ \old_co ->
+ pprPanic "Filling a filled coercion hole" (ppr cv $$ ppr co $$ ppr old_co)
+ traceTc "Filling coercion hole" (ppr cv <+> text ":=" <+> ppr co)
+ writeTcRef ref (Just co)
-- | Is a coercion hole filled in?
isFilledCoercionHole :: CoercionHole -> TcM Bool
diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs
index b0b49be7be..183fe396ef 100644
--- a/compiler/GHC/Tc/Utils/TcType.hs
+++ b/compiler/GHC/Tc/Utils/TcType.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Tc/Utils/Unify.hs b/compiler/GHC/Tc/Utils/Unify.hs
index 4e72cbf61d..5a4fe715c6 100644
--- a/compiler/GHC/Tc/Utils/Unify.hs
+++ b/compiler/GHC/Tc/Utils/Unify.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
diff --git a/compiler/GHC/Tc/Utils/Zonk.hs b/compiler/GHC/Tc/Utils/Zonk.hs
index 4ff7e175a8..7215e09d96 100644
--- a/compiler/GHC/Tc/Utils/Zonk.hs
+++ b/compiler/GHC/Tc/Utils/Zonk.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs
index 25828a7f11..41e1a1c5a9 100644
--- a/compiler/GHC/Tc/Validity.hs
+++ b/compiler/GHC/Tc/Validity.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Types/Avail.hs b/compiler/GHC/Types/Avail.hs
index 897cfcc39f..93c3975ba3 100644
--- a/compiler/GHC/Types/Avail.hs
+++ b/compiler/GHC/Types/Avail.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE DeriveDataTypeable #-}
--
-- (c) The University of Glasgow
diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs
index 52cca60cfb..e8ea103705 100644
--- a/compiler/GHC/Types/Demand.hs
+++ b/compiler/GHC/Types/Demand.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Types/Id.hs b/compiler/GHC/Types/Id.hs
index e4c0432500..8a75ced92c 100644
--- a/compiler/GHC/Types/Id.hs
+++ b/compiler/GHC/Types/Id.hs
@@ -5,7 +5,7 @@
\section[Id]{@Ids@: Value and constructor identifiers}
-}
-{-# LANGUAGE CPP #-}
+
-- |
-- #name_types#
diff --git a/compiler/GHC/Types/Id/Info.hs b/compiler/GHC/Types/Id/Info.hs
index 602a22823e..9de38ccef1 100644
--- a/compiler/GHC/Types/Id/Info.hs
+++ b/compiler/GHC/Types/Id/Info.hs
@@ -8,7 +8,7 @@
Haskell. [WDP 94/11])
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BinaryLiterals #-}
diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs
index 86f68f04dc..dc1663a7ff 100644
--- a/compiler/GHC/Types/Id/Make.hs
+++ b/compiler/GHC/Types/Id/Make.hs
@@ -12,7 +12,7 @@ have a standard form, namely:
- primitive operations
-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
diff --git a/compiler/GHC/Types/Literal.hs b/compiler/GHC/Types/Literal.hs
index 51b88994fa..d7958edb8f 100644
--- a/compiler/GHC/Types/Literal.hs
+++ b/compiler/GHC/Types/Literal.hs
@@ -4,7 +4,7 @@
-}
-{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-}
+{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
diff --git a/compiler/GHC/Types/Name/Cache.hs b/compiler/GHC/Types/Name/Cache.hs
index f1c62c0e56..66fad6dbd8 100644
--- a/compiler/GHC/Types/Name/Cache.hs
+++ b/compiler/GHC/Types/Name/Cache.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE RankNTypes #-}
-- | The Name Cache
diff --git a/compiler/GHC/Types/Name/Env.hs b/compiler/GHC/Types/Name/Env.hs
index 854f7706fe..4182f2c27a 100644
--- a/compiler/GHC/Types/Name/Env.hs
+++ b/compiler/GHC/Types/Name/Env.hs
@@ -5,7 +5,7 @@
\section[NameEnv]{@NameEnv@: name environments}
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/compiler/GHC/Types/Name/Ppr.hs b/compiler/GHC/Types/Name/Ppr.hs
index 0ed83cdce7..bced8034ae 100644
--- a/compiler/GHC/Types/Name/Ppr.hs
+++ b/compiler/GHC/Types/Name/Ppr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Types.Name.Ppr
( mkPrintUnqualified
diff --git a/compiler/GHC/Types/Name/Reader.hs b/compiler/GHC/Types/Name/Reader.hs
index 9571fc17b1..98b3fa66d2 100644
--- a/compiler/GHC/Types/Name/Reader.hs
+++ b/compiler/GHC/Types/Name/Reader.hs
@@ -3,7 +3,8 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
-- |
-- #name_types#
diff --git a/compiler/GHC/Types/Name/Set.hs b/compiler/GHC/Types/Name/Set.hs
index 426b363ee7..d2ffadf429 100644
--- a/compiler/GHC/Types/Name/Set.hs
+++ b/compiler/GHC/Types/Name/Set.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1998
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module GHC.Types.Name.Set (
-- * Names set type
diff --git a/compiler/GHC/Types/Name/Shape.hs b/compiler/GHC/Types/Name/Shape.hs
index aca51faaab..7bb0fad289 100644
--- a/compiler/GHC/Types/Name/Shape.hs
+++ b/compiler/GHC/Types/Name/Shape.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
module GHC.Types.Name.Shape
( NameShape(..)
diff --git a/compiler/GHC/Types/RepType.hs b/compiler/GHC/Types/RepType.hs
index 28df42c4ca..8e4384c602 100644
--- a/compiler/GHC/Types/RepType.hs
+++ b/compiler/GHC/Types/RepType.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
module GHC.Types.RepType
diff --git a/compiler/GHC/Types/TyThing/Ppr.hs b/compiler/GHC/Types/TyThing/Ppr.hs
index 6b30a9c7b1..90b42d537c 100644
--- a/compiler/GHC/Types/TyThing/Ppr.hs
+++ b/compiler/GHC/Types/TyThing/Ppr.hs
@@ -6,7 +6,7 @@
--
-----------------------------------------------------------------------------
-{-# LANGUAGE CPP #-}
+
module GHC.Types.TyThing.Ppr (
pprTyThing,
pprTyThingInContext,
diff --git a/compiler/GHC/Types/Unique.hs b/compiler/GHC/Types/Unique.hs
index 5dffb1bbc8..d5aada61c7 100644
--- a/compiler/GHC/Types/Unique.hs
+++ b/compiler/GHC/Types/Unique.hs
@@ -17,7 +17,8 @@ Some of the other hair in this code is to be able to use a
Haskell).
-}
-{-# LANGUAGE CPP, BangPatterns, MagicHash #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns, MagicHash #-}
module GHC.Types.Unique (
-- * Main data types
diff --git a/compiler/GHC/Types/Unique/FM.hs b/compiler/GHC/Types/Unique/FM.hs
index 07aa675d3b..102025bda2 100644
--- a/compiler/GHC/Types/Unique/FM.hs
+++ b/compiler/GHC/Types/Unique/FM.hs
@@ -23,7 +23,7 @@ of arguments of combining function.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wall #-}
module GHC.Types.Unique.FM (
diff --git a/compiler/GHC/Types/Var.hs b/compiler/GHC/Types/Var.hs
index be860ef2c3..be2c677799 100644
--- a/compiler/GHC/Types/Var.hs
+++ b/compiler/GHC/Types/Var.hs
@@ -5,7 +5,7 @@
\section{@Vars@: Variables}
-}
-{-# LANGUAGE CPP, FlexibleContexts, MultiWayIf, FlexibleInstances, DeriveDataTypeable,
+{-# LANGUAGE FlexibleContexts, MultiWayIf, FlexibleInstances, DeriveDataTypeable,
PatternSynonyms, BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
diff --git a/compiler/GHC/Types/Var/Set.hs b/compiler/GHC/Types/Var/Set.hs
index 109f370f98..e038f6c93c 100644
--- a/compiler/GHC/Types/Var/Set.hs
+++ b/compiler/GHC/Types/Var/Set.hs
@@ -3,7 +3,7 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
-{-# LANGUAGE CPP #-}
+
module GHC.Types.Var.Set (
-- * Var, Id and TyVar set types
diff --git a/compiler/GHC/Unit/Finder.hs b/compiler/GHC/Unit/Finder.hs
index 4f0ec1030b..0a42149a42 100644
--- a/compiler/GHC/Unit/Finder.hs
+++ b/compiler/GHC/Unit/Finder.hs
@@ -3,7 +3,7 @@
-}
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE FlexibleContexts #-}
-- | Module finder
diff --git a/compiler/GHC/Unit/Info.hs b/compiler/GHC/Unit/Info.hs
index b112bd7fee..b2fb1c5e4c 100644
--- a/compiler/GHC/Unit/Info.hs
+++ b/compiler/GHC/Unit/Info.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, RecordWildCards, FlexibleInstances, MultiParamTypeClasses #-}
+{-# LANGUAGE RecordWildCards, FlexibleInstances, MultiParamTypeClasses #-}
-- | Info about installed units (compiled libraries)
module GHC.Unit.Info
diff --git a/compiler/GHC/Unit/State.hs b/compiler/GHC/Unit/State.hs
index 5ae835bc51..99f01c492c 100644
--- a/compiler/GHC/Unit/State.hs
+++ b/compiler/GHC/Unit/State.hs
@@ -1,6 +1,6 @@
-- (c) The University of Glasgow, 2006
-{-# LANGUAGE CPP, ScopedTypeVariables, BangPatterns, FlexibleContexts #-}
+{-# LANGUAGE ScopedTypeVariables, BangPatterns, FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
-- | Unit manipulation
diff --git a/compiler/GHC/Utils/Binary.hs b/compiler/GHC/Utils/Binary.hs
index 24122488a3..51918c87e3 100644
--- a/compiler/GHC/Utils/Binary.hs
+++ b/compiler/GHC/Utils/Binary.hs
@@ -1,3 +1,4 @@
+
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PolyKinds #-}
diff --git a/compiler/GHC/Utils/Error.hs b/compiler/GHC/Utils/Error.hs
index 4f681861c2..a5eccbd7de 100644
--- a/compiler/GHC/Utils/Error.hs
+++ b/compiler/GHC/Utils/Error.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
diff --git a/compiler/GHC/Utils/Fingerprint.hs b/compiler/GHC/Utils/Fingerprint.hs
index c52dc4ed94..95f510ac48 100644
--- a/compiler/GHC/Utils/Fingerprint.hs
+++ b/compiler/GHC/Utils/Fingerprint.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-- ----------------------------------------------------------------------------
diff --git a/compiler/GHC/Utils/IO/Unsafe.hs b/compiler/GHC/Utils/IO/Unsafe.hs
index 40872d43b9..4adf71bd11 100644
--- a/compiler/GHC/Utils/IO/Unsafe.hs
+++ b/compiler/GHC/Utils/IO/Unsafe.hs
@@ -2,7 +2,7 @@
(c) The University of Glasgow, 2000-2006
-}
-{-# LANGUAGE CPP, MagicHash, UnboxedTuples #-}
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
module GHC.Utils.IO.Unsafe
( inlinePerformIO,
diff --git a/compiler/GHC/Utils/Panic.hs b/compiler/GHC/Utils/Panic.hs
index d55cb7b186..fb72886be7 100644
--- a/compiler/GHC/Utils/Panic.hs
+++ b/compiler/GHC/Utils/Panic.hs
@@ -4,7 +4,8 @@
-}
-{-# LANGUAGE CPP, ScopedTypeVariables, LambdaCase #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ScopedTypeVariables, LambdaCase #-}
-- | Defines basic functions for printing error messages.
--
diff --git a/compiler/GHC/Utils/Panic/Plain.hs b/compiler/GHC/Utils/Panic/Plain.hs
index a058f0e0b3..709bbaf152 100644
--- a/compiler/GHC/Utils/Panic/Plain.hs
+++ b/compiler/GHC/Utils/Panic/Plain.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, ScopedTypeVariables, LambdaCase #-}
+{-# LANGUAGE ScopedTypeVariables, LambdaCase #-}
-- | Defines a simple exception type and utilities to throw it. The
-- 'PlainGhcException' type is a subset of the 'GHC.Utils.Panic.GhcException'
diff --git a/compiler/Language/Haskell/Syntax/Decls.hs b/compiler/Language/Haskell/Syntax/Decls.hs
index 59ae54544a..fcbb5856b1 100644
--- a/compiler/Language/Haskell/Syntax/Decls.hs
+++ b/compiler/Language/Haskell/Syntax/Decls.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs
index 722c8f2ccb..e7afc89226 100644
--- a/compiler/Language/Haskell/Syntax/Expr.hs
+++ b/compiler/Language/Haskell/Syntax/Expr.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
diff --git a/compiler/Language/Haskell/Syntax/Lit.hs b/compiler/Language/Haskell/Syntax/Lit.hs
index 568f885011..6e036f4503 100644
--- a/compiler/Language/Haskell/Syntax/Lit.hs
+++ b/compiler/Language/Haskell/Syntax/Lit.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/Language/Haskell/Syntax/Pat.hs b/compiler/Language/Haskell/Syntax/Pat.hs
index df29f74271..76530f3c2f 100644
--- a/compiler/Language/Haskell/Syntax/Pat.hs
+++ b/compiler/Language/Haskell/Syntax/Pat.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/Language/Haskell/Syntax/Type.hs b/compiler/Language/Haskell/Syntax/Type.hs
index c9e19b421c..c872236c78 100644
--- a/compiler/Language/Haskell/Syntax/Type.hs
+++ b/compiler/Language/Haskell/Syntax/Type.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 2751218adf..7766482509 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -64,7 +64,6 @@ define compilerConfig
compiler/stage$1/build/GHC/Settings/Config.hs : mk/config.mk mk/project.mk | $$$$(dir $$$$@)/.
$$(call removeFiles,$$@)
@echo 'Creating $$@ ... '
- @echo '{-# LANGUAGE CPP #-}' >> $$@
@echo 'module GHC.Settings.Config' >> $$@
@echo ' ( module GHC.Version' >> $$@
@echo ' , cBuildPlatformString' >> $$@
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 8dfe49303d..7817cd974f 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiWayIf #-}
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs
index ee6fa2f750..888b536d01 100644
--- a/ghc/GHCi/UI/Monad.hs
+++ b/ghc/GHCi/UI/Monad.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP, FlexibleInstances, DeriveFunctor, DerivingVia #-}
+{-# LANGUAGE FlexibleInstances, DeriveFunctor, DerivingVia #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS -fno-warn-name-shadowing #-}
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 6e4335fbc2..b7b4d17180 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -364,8 +364,7 @@ generateConfigHs = do
cProjectName <- getSetting ProjectName
cBooterVersion <- getSetting GhcVersion
return $ unlines
- [ "{-# LANGUAGE CPP #-}"
- , "module GHC.Settings.Config"
+ [ "module GHC.Settings.Config"
, " ( module GHC.Version"
, " , cBuildPlatformString"
, " , cHostPlatformString"