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 @@
\section[ConLike]{@ConLike@: Constructor-like things}
\begin{code}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module ConLike (
ConLike(..)
......
......@@ -5,7 +5,8 @@
\section[DataCon]{@DataCon@: Data Constructors}
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -5,6 +5,7 @@
\section[Demand]{@Demand@: A decoupled implementation of a demand domain}
\begin{code}
{-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances #-}
module Demand (
StrDmd, UseDmd(..), Count(..),
......
......@@ -5,6 +5,8 @@
\section[Id]{@Ids@: Value and constructor identifiers}
\begin{code}
{-# LANGUAGE CPP #-}
-- |
-- #name_types#
-- GHC uses several kinds of name internally:
......
......@@ -8,7 +8,7 @@
Haskell. [WDP 94/11])
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -5,7 +5,7 @@
\section[Literal]{@Literal@: Machine literals (unboxed, of course)}
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module Literal
(
......
......@@ -12,7 +12,8 @@ have a standard form, namely:
- primitive operations
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- 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
the keys.
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
module Module
(
......
......@@ -5,6 +5,8 @@
\section[Name]{@Name@: to transmit name info from renamer to typechecker}
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
-- |
-- #name_types#
-- GHC uses several kinds of name internally:
......
......@@ -5,7 +5,8 @@
\section[NameEnv]{@NameEnv@: name environments}
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -4,7 +4,8 @@
%
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -4,6 +4,8 @@
%
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
-- |
-- #name_types#
-- GHC uses several kinds of name internally:
......@@ -20,7 +22,7 @@
--
-- * 'Var.Var': see "Var#name_types"
{-# OPTIONS -fno-warn-tabs #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -5,6 +5,7 @@
\section[PatSyn]{@PatSyn@: Pattern synonyms}
\begin{code}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module PatSyn (
-- * Main data types
......
......@@ -4,7 +4,7 @@
%
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
-- |
-- #name_types#
......
......@@ -3,6 +3,7 @@
%
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
-- Workaround for Trac #5252 crashes the bootstrap compiler without -O
-- When the earliest compiler we want to boostrap with is
......
......@@ -4,6 +4,8 @@
%
\begin{code}
{-# LANGUAGE UnboxedTuples #-}
module UniqSupply (
-- * Main data type
UniqSupply, -- Abstractly
......
......@@ -16,7 +16,7 @@ Some of the other hair in this code is to be able to use a
Haskell).
\begin{code}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP, BangPatterns, MagicHash #-}
module Unique (
-- * Main data types
......
......@@ -5,7 +5,8 @@
\section{@Vars@: Variables}
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -4,7 +4,8 @@
%
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
{-# LANGUAGE CPP #-}
--
-- (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 #-}
{- BlockId module should probably go away completely, being superseded by Label -}
module BlockId
( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, BlockSet, BlockEnv
......
-- Cmm representations using Hoopl's Graph CmmNode e x.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE CPP, GADTs #-}
module Cmm (
-- * Cmm top-level datatypes
......
{-# LANGUAGE GADTs #-}
{-# LANGUAGE CPP, GADTs #-}
-- See Note [Deprecations in Hoopl] in Hoopl module
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
......
{-# LANGUAGE CPP #-}
module CmmCallConv (
ParamLocation(..),
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
module CmmExpr
......
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
{-# LANGUAGE RecordWildCards, GADTs #-}
{-# LANGUAGE CPP, RecordWildCards, GADTs #-}
module CmmLayoutStack (
cmmLayoutStack, setInfoTableStackMap
) where
......
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
......
{-# LANGUAGE CPP #-}
module CmmMachOp
( MachOp(..)
......
-- CmmNode type for representation using Hoopl graphs.
{-# LANGUAGE CPP #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
-- CmmNode type for representation using Hoopl graphs.
module CmmNode (
CmmNode(..), CmmFormal, CmmActual,
UpdFrameOffset, Convention(..),
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Cmm optimisation
......
{-# LANGUAGE BangPatterns #-}
module CmmPipeline (
-- | Converts C-- with an implicit stack and native C-- calls into
-- optimized, CPS converted and native-call-less C--. The latter
......
{-# LANGUAGE CPP #-}
module CmmType
( CmmType -- Abstract
......
{-# LANGUAGE GADTs #-}
{-# LANGUAGE CPP, GADTs, RankNTypes #-}
-----------------------------------------------------------------------------
--
......
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
module Hoopl (
module Compiler.Hoopl,
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,
-- and Norman Ramsey
......@@ -9,10 +18,6 @@
-- specialised to the UniqSM monad.
--
{-# LANGUAGE RankNTypes, ScopedTypeVariables, GADTs, TypeFamilies, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fprof-auto-top #-}
{-# LANGUAGE Trustworthy #-}
module Hoopl.Dataflow
( DataflowLattice(..), OldFact(..), NewFact(..), Fact, mkFactBase
, ChangeFlag(..)
......
{-# LANGUAGE GADTs #-}
{-# LANGUAGE BangPatterns, CPP, GADTs #-}
module MkGraph
( CmmAGraph, CgStmt(..)
......
{-# LANGUAGE CPP, GADTs #-}
-----------------------------------------------------------------------------
--
-- Pretty-printing of Cmm as C, suitable for feeding gcc
......@@ -16,7 +18,6 @@
--
-----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-}
module PprC (
writeCs,
pprStringInCStyle
......
{-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts, FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
----------------------------------------------------------------------------
--
-- Pretty-printing of Cmm as (a superset of) C--
......@@ -30,8 +33,6 @@
--
-- A useful example pass over Cmm is in nativeGen/MachCodeGen.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE GADTs, TypeFamilies, FlexibleContexts #-}
module PprCmm
( module PprCmmDecl
, module PprCmmExpr
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------
--
-- Pretty-printing of common Cmm types
......
......@@ -6,7 +6,7 @@
Storage manager representation of closures
\begin{code}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE CPP,GeneralizedNewtypeDeriving #-}
module SMRep (
-- * Words and bytes
......
{-# LANGUAGE CPP, GADTs #-}
-----------------------------------------------------------------------------
--
-- Code generator utilities; mostly monadic
......@@ -6,7 +8,6 @@
--
-----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-}
module CgUtils ( fixStgRegisters ) where
#include "HsVersions.h"
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.ARM where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.NoRegs where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.PPC where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.PPC_Darwin where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.SPARC where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.X86 where
......
{-# LANGUAGE CPP #-}
module CodeGen.Platform.X86_64 where
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C-- code generation
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C-- code generation: bindings
......
{-# LANGUAGE CPP, RecordWildCards #-}
-----------------------------------------------------------------------------
--
-- Stg to C-- code generation:
......@@ -9,8 +11,6 @@
--
-----------------------------------------------------------------------------
{-# LANGUAGE RecordWildCards #-}
module StgCmmClosure (
DynTag, tagForCon, isSmallFamily,
ConTagZ, dataConTagZ,
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C--: code generation for constructors
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C-- code generation: the binding environment
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C-- code generation: expressions
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Code generation for foreign calls.
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Stg to C--: heap management functions
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Building info tables.
......
{-# LANGUAGE GADTs #-}
{-# LANGUAGE CPP, GADTs, UnboxedTuples #-}
-----------------------------------------------------------------------------
--
-- Monad for Stg to C-- code generation
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------
--
-- Stg to C--: primitive operations
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Code generation for profiling
......
{-# LANGUAGE BangPatterns, CPP #-}
-----------------------------------------------------------------------------
--
-- Code generation for ticky-ticky profiling
......
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Code generator utilities; mostly monadic
......
......@@ -6,7 +6,8 @@
Arity and eta expansion
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -5,6 +5,8 @@
Taken quite directly from the Peyton Jones/Lester paper.
\begin{code}
{-# LANGUAGE CPP #-}
-- | A module concerned with finding the free variables of an expression.
module CoreFVs (
-- * Free variables of expressions and binding groups
......
......@@ -7,12 +7,7 @@
A ``lint'' pass to check for Core correctness
\begin{code}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fprof-auto #-}
module CoreLint ( lintCoreBindings, lintUnfolding, lintExpr ) where
......
......@@ -5,7 +5,7 @@
Core pass to saturate constructors and PrimOps
\begin{code}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BangPatterns, CPP #-}
module CorePrep (
corePrepPgm, corePrepExpr, cvtLitInteger,
......
......@@ -6,7 +6,8 @@
Utility functions on @Core@ syntax
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -4,9 +4,8 @@
%
\begin{code}
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor #-}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
......
......@@ -7,7 +7,8 @@ This module contains "tidying" code for *nested* expressions, bindings, rules.
The code for *top-level* bindings is in TidyPgm.
\begin{code}
{-# OPTIONS -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}