Commit 5df7cf32 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Detab modules with tabs on 5 lines or fewer

parent 872f2c8b
--
-- (c) The University of Glasgow 2003-2006
--
--
-- Functions for constructing bitmaps, which are used in various
-- places in generated code (stack frame liveness masks, function
-- argument liveness masks, SRT bitmaps).
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
mAX_SMALL_BITMAP_SIZE,
seqBitmap,
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
mAX_SMALL_BITMAP_SIZE,
seqBitmap,
) where
#include "HsVersions.h"
......@@ -53,8 +46,8 @@ chunkToBitmap dflags chunk =
intsToBitmap :: DynFlags -> Int -> [Int] -> Bitmap
intsToBitmap dflags size slots{- must be sorted -}
| size <= 0 = []
| otherwise =
(foldr (.|.) (toStgWord dflags 0) (map (toStgWord dflags 1 `shiftL`) these)) :
| otherwise =
(foldr (.|.) (toStgWord dflags 0) (map (toStgWord dflags 1 `shiftL`) these)) :
intsToBitmap dflags (size - wORD_SIZE_IN_BITS dflags)
(map (\x -> x - wORD_SIZE_IN_BITS dflags) rest)
where (these,rest) = span (< wORD_SIZE_IN_BITS dflags) slots
......@@ -67,7 +60,7 @@ intsToBitmap dflags size slots{- must be sorted -}
intsToReverseBitmap :: DynFlags -> Int -> [Int] -> Bitmap
intsToReverseBitmap dflags size slots{- must be sorted -}
| size <= 0 = []
| otherwise =
| otherwise =
(foldr xor (toStgWord dflags init) (map (toStgWord dflags 1 `shiftL`) these)) :
intsToReverseBitmap dflags (size - wORD_SIZE_IN_BITS dflags)
(map (\x -> x - wORD_SIZE_IN_BITS dflags) rest)
......
{-# LANGUAGE GADTs, NoMonoLocalBinds #-}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
-- Norman likes local bindings
-- If this module lives on I'd like to get rid of the NoMonoLocalBinds
......@@ -164,7 +158,7 @@ srtToData srt = [CmmData RelocatableReadOnlyData (Statics (lbl srt) tbl)]
-- 1. Build a table of all the CAFs used in the procedure.
-- 2. Compute the C_SRT describing the subset of CAFs live at each procpoint.
--
-- When building the local view of the SRT, we first make sure that all the CAFs are
-- When building the local view of the SRT, we first make sure that all the CAFs are
-- in the SRT. Then, if the number of CAFs is small enough to fit in a bitmap,
-- we make sure they're all close enough to the bottom of the table that the
-- bitmap will be able to cover all of them.
......@@ -240,7 +234,7 @@ to_SRT dflags top_srt off len bmp
return (Just tbl, C_SRT srt_desc_lbl 0 (srtEscape dflags))
| otherwise
= return (Nothing, C_SRT top_srt off (toStgHalfWord dflags (fromStgWord (head bmp))))
-- The fromIntegral converts to StgHalfWord
-- The fromIntegral converts to StgHalfWord
-- Gather CAF info for a procedure, but only if the procedure
-- doesn't have a static closure.
......
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module CmmCallConv (
ParamLocation(..),
......@@ -93,7 +87,7 @@ assignArgumentsPos dflags off conv arg_ty reps = (stk_off, assignments)
ty = arg_ty r
w = typeWidth ty
gcp | isGcPtrType ty = VGcPtr
| otherwise = VNonGcPtr
| otherwise = VNonGcPtr
hasSseRegs = mAX_Real_SSE_REG dflags /= 0
......@@ -133,7 +127,7 @@ getRegsWithoutNode dflags =
( filter (\r -> r VGcPtr /= node) (realVanillaRegs dflags)
, realFloatRegs dflags
, realDoubleRegs dflags
, realLongRegs dflags
, realLongRegs dflags
, sseRegNos dflags)
-- getRegsWithNode uses R1/node even if it isn't a register
......
......@@ -2,29 +2,22 @@
% (c) The University of Glasgow 2001-2006
%
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module ExternalCore where
import Data.Word
data Module
data Module
= Module Mname [Tdef] [Vdefg]
data Tdef
data Tdef
= Data (Qual Tcon) [Tbind] [Cdef]
| Newtype (Qual Tcon) (Qual Tcon) [Tbind] Ty
data Cdef
data Cdef
= Constr (Qual Dcon) [Tbind] [Ty]
| GadtConstr (Qual Dcon) Ty
data Vdefg
data Vdefg
= Rec [Vdef]
| Nonrec Vdef
......@@ -32,26 +25,26 @@ data Vdefg
-- around the module name.
type Vdef = (Bool,Qual Var,Ty,Exp)
data Exp
data Exp
= Var (Qual Var)
| Dcon (Qual Dcon)
| Lit Lit
| App Exp Exp
| Appt Exp Ty
| Lam Bind Exp
| Lam Bind Exp
| Let Vdefg Exp
| Case Exp Vbind Ty [Alt] {- non-empty list -}
| Cast Exp Ty
| Tick String Exp {- XXX probably wrong -}
| External String String Ty {- target name, convention, and type -}
| DynExternal String Ty {- convention and type (incl. Addr# of target as first arg) -}
| External String String Ty {- target name, convention, and type -}
| DynExternal String Ty {- convention and type (incl. Addr# of target as first arg) -}
| Label String
data Bind
data Bind
= Vb Vbind
| Tb Tbind
data Alt
data Alt
= Acon (Qual Dcon) [Tbind] [Vbind] Exp
| Alit Lit Exp
| Adefault Exp
......@@ -62,11 +55,11 @@ type Tbind = (Tvar,Kind)
-- Internally, we represent types and coercions separately; but for
-- the purposes of external core (at least for now) it's still
-- convenient to collapse them into a single type.
data Ty
data Ty
= Tvar Tvar
| Tcon (Qual Tcon)
| Tapp Ty Ty
| Tforall Tbind Ty
| Tforall Tbind Ty
-- We distinguish primitive coercions because External Core treats
-- them specially, so we have to print them out with special syntax.
| TransCoercion Ty Ty
......@@ -79,19 +72,19 @@ data Ty
data LeftOrRight = CLeft | CRight
data Kind
data Kind
= Klifted
| Kunlifted
| Kunboxed
| Kopen
| Karrow Kind Kind
data Lit
data Lit
= Lint Integer Ty
| Lrational Rational Ty
| Lchar Char Ty
| Lstring [Word8] Ty
type Mname = Id
type Var = Id
......
......@@ -7,18 +7,11 @@
Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@.
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
{-# LANGUAGE DeriveDataTypeable #-}
module HsBinds where
import {-# SOURCE #-} HsExpr ( pprExpr, LHsExpr,
import {-# SOURCE #-} HsExpr ( pprExpr, LHsExpr,
MatchGroup, pprFunBind,
GRHSs, pprPatBind )
import {-# SOURCE #-} HsPat ( LPat )
......@@ -32,7 +25,7 @@ import Type
import Name
import NameSet
import BasicTypes
import Outputable
import Outputable
import SrcLoc
import Var
import Bag
......@@ -368,9 +361,9 @@ ppr_monobind (FunBind { fun_id = fun, fun_infix = inf,
ppr_monobind (AbsBinds { abs_tvs = tyvars, abs_ev_vars = dictvars
, abs_exports = exports, abs_binds = val_binds
, abs_ev_binds = ev_binds })
= hang (ptext (sLit "AbsBinds") <+> brackets (interpp'SP tyvars)
= hang (ptext (sLit "AbsBinds") <+> brackets (interpp'SP tyvars)
<+> brackets (interpp'SP dictvars))
2 $ braces $ vcat
2 $ braces $ vcat
[ ptext (sLit "Exports:") <+> brackets (sep (punctuate comma (map ppr exports)))
, ptext (sLit "Exported types:") <+> vcat [pprBndr LetBind (abe_poly ex) | ex <- exports]
, ptext (sLit "Binds:") <+> pprLHsBinds val_binds
......
......@@ -6,18 +6,11 @@
--
-----------------------------------------------------------------------------
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module PprBase (
castFloatToWord8Array,
castDoubleToWord8Array,
floatToBytes,
doubleToBytes
castFloatToWord8Array,
castDoubleToWord8Array,
floatToBytes,
doubleToBytes
)
where
......@@ -41,7 +34,7 @@ castDoubleToWord8Array :: STUArray s Int Double -> ST s (STUArray s Int Word8)
castDoubleToWord8Array = castSTUArray
-- floatToBytes and doubleToBytes convert to the host's byte
-- order. Providing that we're not cross-compiling for a
-- order. Providing that we're not cross-compiling for a
-- target with the opposite endianness, this should work ok
-- on all targets.
......
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module SPARC.AddrMode (
AddrMode(..),
addrOffset
AddrMode(..),
addrOffset
)
where
......@@ -20,11 +13,11 @@ import Reg
-- addressing modes ------------------------------------------------------------
-- | Represents a memory address in an instruction.
-- Being a RISC machine, the SPARC addressing modes are very regular.
-- Being a RISC machine, the SPARC addressing modes are very regular.
--
data AddrMode
= AddrRegReg Reg Reg -- addr = r1 + r2
| AddrRegImm Reg Imm -- addr = r1 + imm
= AddrRegReg Reg Reg -- addr = r1 + r2
| AddrRegImm Reg Imm -- addr = r1 + imm
-- | Add an integer offset to the address in an AddrMode.
......@@ -45,5 +38,5 @@ addrOffset addr off
AddrRegReg r (RegReal (RealRegSingle 0))
| fits13Bits off -> Just (AddrRegImm r (ImmInt off))
| otherwise -> Nothing
_ -> Nothing
......@@ -4,13 +4,6 @@
\section[SimplCore]{Driver for simplifying @Core@ programs}
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module SimplCore ( core2core, simplifyExpr ) where
#include "HsVersions.h"
......@@ -203,7 +196,7 @@ getCoreToDo dflags
[ vectorisation
, CoreDoSimplify max_iter
(base_mode { sm_phase = Phase 0
, sm_names = ["Non-opt simplification"] })
, sm_names = ["Non-opt simplification"] })
]
else {- opt_level >= 1 -} [
......@@ -498,16 +491,16 @@ simplifyExpr dflags expr
; us <- mkSplitUniqSupply 's'
; let sz = exprSize expr
; let sz = exprSize expr
; (expr', counts) <- initSmpl dflags emptyRuleBase emptyFamInstEnvs us sz $
simplExprGently (simplEnvForGHCi dflags) expr
simplExprGently (simplEnvForGHCi dflags) expr
; Err.dumpIfSet dflags (dopt Opt_D_dump_simpl_stats dflags)
"Simplifier statistics" (pprSimplCount counts)
; Err.dumpIfSet_dyn dflags Opt_D_dump_simpl "Simplified expression"
(pprCoreExpr expr')
; Err.dumpIfSet_dyn dflags Opt_D_dump_simpl "Simplified expression"
(pprCoreExpr expr')
; return expr'
}
......@@ -618,16 +611,16 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode)
-- that the binders representing variable vectorisation declarations are kept alive.
-- (In contrast to automatically vectorised variables, their unvectorised versions
-- don't depend on them.)
vectVars = mkVarSet $
catMaybes [ fmap snd $ lookupVarEnv (vectInfoVar (mg_vect_info guts)) bndr
vectVars = mkVarSet $
catMaybes [ fmap snd $ lookupVarEnv (vectInfoVar (mg_vect_info guts)) bndr
| Vect bndr _ <- mg_vect_decls guts]
++
catMaybes [ fmap snd $ lookupVarEnv (vectInfoVar (mg_vect_info guts)) bndr
catMaybes [ fmap snd $ lookupVarEnv (vectInfoVar (mg_vect_info guts)) bndr
| bndr <- bindersOfBinds binds]
-- FIXME: This second comprehensions is only needed as long as we
-- have vectorised bindings where we get "Could NOT call
-- vectorised from original version".
; (maybeVects, maybeVectVars)
; (maybeVects, maybeVectVars)
= case sm_phase mode of
InitialPhase -> (mg_vect_decls guts, vectVars)
_ -> ([], vectVars)
......
......@@ -7,13 +7,6 @@ And, as we have the info in hand, we may convert some lets to
let-no-escapes.
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module CoreToStg ( coreToStg, coreExprToStg ) where
#include "HsVersions.h"
......@@ -25,7 +18,7 @@ import StgSyn
import Type
import TyCon
import MkId ( coercionTokenId )
import MkId ( coercionTokenId )
import Id
import IdInfo
import DataCon
......@@ -364,8 +357,8 @@ coreToStgExpr (Cast expr _)
-- Cases require a little more real work.
coreToStgExpr (Case scrut _ _ [])
= coreToStgExpr scrut
coreToStgExpr (Case scrut _ _ [])
= coreToStgExpr scrut
-- See Note [Empty case alternatives] in CoreSyn If the case
-- alternatives are empty, the scrutinee must diverge or raise an
-- exception, so we can just dive into it.
......@@ -374,7 +367,7 @@ coreToStgExpr (Case scrut _ _ [])
-- belt-and-braces approach would be to move this case into the
-- code generator, and put a return point anyway that calls a
-- runtime system error function.
coreToStgExpr (Case scrut bndr _ alts) = do
(alts2, alts_fvs, alts_escs)
......@@ -422,7 +415,7 @@ coreToStgExpr (Case scrut bndr _ alts) = do
where
vars_alt (con, binders, rhs)
| DataAlt c <- con, c == unboxedUnitDataCon
= -- This case is a bit smelly.
= -- This case is a bit smelly.
-- See Note [Nullary unboxed tuple] in Type.lhs
-- where a nullary tuple is mapped to (State# World#)
ASSERT( null binders )
......@@ -811,7 +804,7 @@ mkStgRhs rhs_fvs srt binder_info rhs
assumptions (namely that they will be entered only once).
upd_flag | isPAP env rhs = ReEntrant
| otherwise = Updatable
| otherwise = Updatable
-}
{- ToDo:
......
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS -cpp #-}
{-# OPTIONS_GHC -O #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is severely affected
--
-- (c) The University of Glasgow 2002-2006
--
-- Unboxed mutable Ints
module FastMutInt(
FastMutInt, newFastMutInt,
readFastMutInt, writeFastMutInt,
FastMutInt, newFastMutInt,
readFastMutInt, writeFastMutInt,
FastMutPtr, newFastMutPtr,
readFastMutPtr, writeFastMutPtr
FastMutPtr, newFastMutPtr,
readFastMutPtr, writeFastMutPtr
) where
#ifdef __GLASGOW_HASKELL__
......
......@@ -4,13 +4,6 @@
%
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module Maybes (
module Data.Maybe,
......@@ -85,9 +78,9 @@ Nothing `orElse` y = y
\end{code}
%************************************************************************
%* *
%* *
\subsection[MaybeT type]{The @MaybeT@ monad transformer}
%* *
%* *
%************************************************************************
\begin{code}
......
......@@ -9,15 +9,8 @@ Provide trees (of instructions), so that lists of instructions
can be appended in linear time.
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module OrdList (
OrdList,
OrdList,
nilOL, isNilOL, unitOL, appOL, consOL, snocOL, concatOL,
mapOL, fromOL, toOL, foldrOL, foldlOL
) where
......
......@@ -9,13 +9,6 @@ Based on @UniqFMs@ (as you would expect).
Basically, the things need to be in class @Uniquable@.
\begin{code}
{-# OPTIONS -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
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module UniqSet (
-- * Unique set type
UniqSet, -- type synonym for UniqFM a
......@@ -46,9 +39,9 @@ import Unique
\end{code}
%************************************************************************
%* *
%* *
\subsection{The signature of the module}
%* *
%* *
%************************************************************************
\begin{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment