Commit 23892440 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Add LANGUAGE pragmas to compiler/ source files

In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
reorganized, while following the convention, to

- place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
  any `{-# OPTIONS_GHC #-}`-lines.

- Moreover, if the list of language extensions fit into a single
  `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
  line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
  individual language extension. In both cases, try to keep the
  enumeration alphabetically ordered.
  (The latter layout is preferable as it's more diff-friendly)

While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
parent e199891f
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
\section[ConLike]{@ConLike@: Constructor-like things} \section[ConLike]{@ConLike@: Constructor-like things}
\begin{code} \begin{code}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module ConLike ( module ConLike (
ConLike(..) ConLike(..)
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
\section[DataCon]{@DataCon@: Data Constructors} \section[DataCon]{@DataCon@: Data Constructors}
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
\section[Demand]{@Demand@: A decoupled implementation of a demand domain} \section[Demand]{@Demand@: A decoupled implementation of a demand domain}
\begin{code} \begin{code}
{-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances #-}
module Demand ( module Demand (
StrDmd, UseDmd(..), Count(..), StrDmd, UseDmd(..), Count(..),
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
\section[Id]{@Ids@: Value and constructor identifiers} \section[Id]{@Ids@: Value and constructor identifiers}
\begin{code} \begin{code}
{-# LANGUAGE CPP #-}
-- | -- |
-- #name_types# -- #name_types#
-- GHC uses several kinds of name internally: -- GHC uses several kinds of name internally:
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Haskell. [WDP 94/11]) Haskell. [WDP 94/11])
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\section[Literal]{@Literal@: Machine literals (unboxed, of course)} \section[Literal]{@Literal@: Machine literals (unboxed, of course)}
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE CPP, DeriveDataTypeable #-}
module Literal module Literal
( (
......
...@@ -12,7 +12,8 @@ have a standard form, namely: ...@@ -12,7 +12,8 @@ have a standard form, namely:
- primitive operations - primitive operations
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -9,6 +9,7 @@ These are Uniquable, hence we can build Maps with Modules as ...@@ -9,6 +9,7 @@ These are Uniquable, hence we can build Maps with Modules as
the keys. the keys.
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
module Module module Module
( (
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
\section[Name]{@Name@: to transmit name info from renamer to typechecker} \section[Name]{@Name@: to transmit name info from renamer to typechecker}
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
-- | -- |
-- #name_types# -- #name_types#
-- GHC uses several kinds of name internally: -- GHC uses several kinds of name internally:
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
\section[NameEnv]{@NameEnv@: name environments} \section[NameEnv]{@NameEnv@: name environments}
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
% %
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
% %
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
-- | -- |
-- #name_types# -- #name_types#
-- GHC uses several kinds of name internally: -- GHC uses several kinds of name internally:
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
-- --
-- * 'Var.Var': see "Var#name_types" -- * 'Var.Var': see "Var#name_types"
{-# OPTIONS -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
\section[PatSyn]{@PatSyn@: Pattern synonyms} \section[PatSyn]{@PatSyn@: Pattern synonyms}
\begin{code} \begin{code}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module PatSyn ( module PatSyn (
-- * Main data types -- * Main data types
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
% %
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE CPP, DeriveDataTypeable #-}
-- | -- |
-- #name_types# -- #name_types#
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
% %
\begin{code} \begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-} {-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
-- Workaround for Trac #5252 crashes the bootstrap compiler without -O -- Workaround for Trac #5252 crashes the bootstrap compiler without -O
-- When the earliest compiler we want to boostrap with is -- When the earliest compiler we want to boostrap with is
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
% %
\begin{code} \begin{code}
{-# LANGUAGE UnboxedTuples #-}
module UniqSupply ( module UniqSupply (
-- * Main data type -- * Main data type
UniqSupply, -- Abstractly UniqSupply, -- Abstractly
......
...@@ -16,7 +16,7 @@ Some of the other hair in this code is to be able to use a ...@@ -16,7 +16,7 @@ Some of the other hair in this code is to be able to use a
Haskell). Haskell).
\begin{code} \begin{code}
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP, BangPatterns, MagicHash #-}
module Unique ( module Unique (
-- * Main data types -- * Main data types
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
\section{@Vars@: Variables} \section{@Vars@: Variables}
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
% %
\begin{code} \begin{code}
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
{-# LANGUAGE CPP #-}
-- --
-- (c) The University of Glasgow 2003-2006 -- (c) The University of Glasgow 2003-2006
-- --
......
{- BlockId module should probably go away completely, being superseded by Label -} {-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-orphans #-}
{- BlockId module should probably go away completely, being superseded by Label -}
module BlockId module BlockId
( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet ( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, BlockSet, BlockEnv , BlockSet, BlockEnv
......
-- Cmm representations using Hoopl's Graph CmmNode e x. -- Cmm representations using Hoopl's Graph CmmNode e x.
{-# LANGUAGE GADTs #-} {-# LANGUAGE CPP, GADTs #-}
module Cmm ( module Cmm (
-- * Cmm top-level datatypes -- * Cmm top-level datatypes
......
{-# LANGUAGE GADTs #-} {-# LANGUAGE CPP, GADTs #-}
-- See Note [Deprecations in Hoopl] in Hoopl module -- See Note [Deprecations in Hoopl] in Hoopl module
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
......
{-# LANGUAGE CPP #-}
module CmmCallConv ( module CmmCallConv (
ParamLocation(..), ParamLocation(..),
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableInstances #-}
module CmmExpr module CmmExpr
......
{-# OPTIONS -fno-warn-tabs #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge. -- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and -- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See -- detab the module (please do the detabbing in a separate patch). See
......
{-# LANGUAGE RecordWildCards, GADTs #-} {-# LANGUAGE CPP, RecordWildCards, GADTs #-}
module CmmLayoutStack ( module CmmLayoutStack (
cmmLayoutStack, setInfoTableStackMap cmmLayoutStack, setInfoTableStackMap
) where ) where
......
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
......
{-# LANGUAGE CPP #-}
module CmmMachOp module CmmMachOp
( MachOp(..) ( MachOp(..)
......
-- CmmNode type for representation using Hoopl graphs. {-# LANGUAGE CPP #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableInstances #-}
-- CmmNode type for representation using Hoopl graphs.
module CmmNode ( module CmmNode (
CmmNode(..), CmmFormal, CmmActual, CmmNode(..), CmmFormal, CmmActual,
UpdFrameOffset, Convention(..), UpdFrameOffset, Convention(..),
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
-- Cmm optimisation -- Cmm optimisation
......
{-# LANGUAGE BangPatterns #-}
module CmmPipeline ( module CmmPipeline (
-- | Converts C-- with an implicit stack and native C-- calls into -- | Converts C-- with an implicit stack and native C-- calls into
-- optimized, CPS converted and native-call-less C--. The latter -- optimized, CPS converted and native-call-less C--. The latter
......
{-# LANGUAGE CPP #-}
module CmmType module CmmType
( CmmType -- Abstract ( CmmType -- Abstract
......
{-# LANGUAGE GADTs #-} {-# LANGUAGE CPP, GADTs, RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
......
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
module Hoopl ( module Hoopl (
module Compiler.Hoopl, module Compiler.Hoopl,
module Hoopl.Dataflow, module Hoopl.Dataflow,
......
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fprof-auto-top #-}
-- --
-- Copyright (c) 2010, João Dias, Simon Marlow, Simon Peyton Jones, -- Copyright (c) 2010, João Dias, Simon Marlow, Simon Peyton Jones,
-- and Norman Ramsey -- and Norman Ramsey
...@@ -9,10 +18,6 @@ ...@@ -9,10 +18,6 @@
-- specialised to the UniqSM monad. -- specialised to the UniqSM monad.
-- --
{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, TypeFamilies, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fprof-auto-top #-}
{-# LANGUAGE Trustworthy #-}
module Hoopl.Dataflow module Hoopl.Dataflow
( DataflowLattice(..), OldFact(..), NewFact(..), Fact, mkFactBase ( DataflowLattice(..), OldFact(..), NewFact(..), Fact, mkFactBase
, ChangeFlag(..) , ChangeFlag(..)
......
{-# LANGUAGE GADTs #-} {-# LANGUAGE BangPatterns, CPP, GADTs #-}
module MkGraph module MkGraph
( CmmAGraph, CgStmt(..) ( CmmAGraph, CgStmt(..)
......
{-# LANGUAGE CPP, GADTs #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
-- Pretty-printing of Cmm as C, suitable for feeding gcc -- Pretty-printing of Cmm as C, suitable for feeding gcc
...@@ -16,7 +18,6 @@ ...@@ -16,7 +18,6 @@
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-}
module PprC ( module PprC (
writeCs, writeCs,
pprStringInCStyle pprStringInCStyle
......
{-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts, FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
-- --
-- Pretty-printing of Cmm as (a superset of) C-- -- Pretty-printing of Cmm as (a superset of) C--
...@@ -30,8 +33,6 @@ ...@@ -30,8 +33,6 @@
-- --
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs -- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts #-}
module PprCmm module PprCmm
( module PprCmmDecl ( module PprCmmDecl
, module PprCmmExpr , module PprCmmExpr
......