Commit 30c122df authored by Ian Lynagh's avatar Ian Lynagh

Don't import FastString in HsVersions.h

Modules that need it import it themselves instead.
parent 7c7104a5
......@@ -60,21 +60,12 @@ name = Util.global (value);
#define WARN(e,msg) if False && (e) then pprPanic "WARN" (msg) else
#endif
-- This conditional lets us switch off the "import FastString"
-- when compiling FastString itself, or when compiling modules that
-- don't use it (and would otherwise get warnings, which we treat
-- as errors). Can we do this more nicely?
#if !defined(COMPILING_FAST_STRING) && !defined(FAST_STRING_NOT_NEEDED)
--
import qualified FastString as FS
#endif
#if defined(__GLASGOW_HASKELL__)
#define SLIT(x) (FS.mkLitString# (x#))
#define FSLIT(x) (FS.mkFastString# (x#))
#define SLIT(x) (FastString.mkLitString# (x#))
#define FSLIT(x) (FastString.mkFastString# (x#))
#else
#define SLIT(x) (FS.mkLitString (x))
#define FSLIT(x) (FS.mkFastString (x))
#define SLIT(x) (FastString.mkLitString (x))
#define FSLIT(x) (FastString.mkFastString (x))
#endif
-- Useful for declaring arguments to be strict
......
......@@ -58,7 +58,7 @@ module BasicTypes(
#include "HsVersions.h"
import FastString( FastString )
import FastString
import Outputable
\end{code}
......
......@@ -92,6 +92,7 @@ import ForeignCall
import NewDemand
import Outputable
import Module
import FastString
import Data.Maybe
......
......@@ -16,8 +16,6 @@ module NameEnv (
elemNameEnv, mapNameEnv
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Name
......
......@@ -22,8 +22,6 @@ module NameSet (
findUses, duDefs, duUses, allUses
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Name
......
......@@ -23,8 +23,6 @@ module NewDemand(
pprIfaceStrictSig, appIsBottom, isBottomingSig, seqStrictSig,
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import StaticFlags
......
......@@ -46,6 +46,7 @@ import Maybes
import Outputable
import FastTypes
import StaticFlags
import FastString
\end{code}
......
......@@ -17,8 +17,6 @@ module VarSet (
elemVarSetByKey
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Var
......
......@@ -33,6 +33,7 @@ import StaticFlags
import Unique
import Maybe
import List
import FastString
import Panic
......
......@@ -276,6 +276,3 @@ mkStdInfoTable type_descr closure_descr cl_type srt_len layout_lit
type_lit = packHalfWordsCLit cl_type srt_len
_unused :: FS.FastString -- stops a warning
_unused = undefined
......@@ -27,6 +27,7 @@ import Outputable
import PprCmm
import Unique
import Constants
import FastString
import Control.Monad
......
......@@ -574,5 +574,3 @@ isComparisonExpr _other = False
isPicReg (CmmReg (CmmGlobal PicBaseReg)) = True
isPicReg _ = False
_unused :: FS.FastString -- stops a warning
_unused = undefined
......@@ -90,6 +90,7 @@ module MachOp (
import Constants
import Outputable
import FastString
-- -----------------------------------------------------------------------------
-- MachRep
......
......@@ -360,5 +360,3 @@ Emitting a Branch at this point is fine:
freshBlockId :: String -> UniqSM BlockId
freshBlockId _ = do { u <- getUniqueUs; return $ BlockId u }
_unused :: FS.FastString
_unused = undefined
......@@ -48,11 +48,6 @@ oneLessFuel f = f
diffFuel _ _ = 0
#endif
-- stop warnings about things that aren't used
_unused :: {-State#-} () -> FS.FastString
_unused = undefined panic
data FuelState = FuelState { fs_fuellimit :: OptimizationFuel, fs_lastpass :: String }
newtype FuelMonad a = FuelMonad (FuelState -> (a, FuelState))
......
......@@ -707,5 +707,3 @@ pprGraph (Graph tail blockenv) =
where pprBlock (Block id tail) = ppr id <> colon $$ ppr tail
blocks = postorder_dfs_from blockenv tail
_unused :: FS.FastString
_unused = undefined
......@@ -1088,10 +1088,6 @@ subAnalysis' m =
where pprFacts env = nest 2 $ vcat $ map pprFact $ ufmToList env
pprFact (id, a) = hang (ppr id <> colon) 4 (ppr a)
_unused :: FS.FastString
_unused = undefined
null_b_ft = BComp "do nothing" Nothing no2 no2 no2
where no2 _ _ = Nothing
......
......@@ -62,6 +62,7 @@ import StgSyn
import Unique
import UniqSet
import Outputable
import FastString
\end{code}
......
......@@ -52,6 +52,7 @@ import PrelInfo
import Outputable
import ListSetOps
import Util
import FastString
\end{code}
......
......@@ -43,6 +43,7 @@ import ClosureInfo
import Constants
import StaticFlags
import Outputable
import FastString
import Control.Monad
......
......@@ -52,6 +52,7 @@ import Util
import Constants
import PackageConfig
import Outputable
import FastString
import Data.List
\end{code}
......
......@@ -35,6 +35,7 @@ import PrimOp
import SMRep
import Constants
import Outputable
import FastString
-- ---------------------------------------------------------------------------
-- Code generation for PrimOps
......
......@@ -474,8 +474,3 @@ adjustSpAndHp newRealSp
}
\end{code}
Some things are unused.
\begin{code}
_unused :: FS.FastString
_unused = undefined
\end{code}
......@@ -53,6 +53,7 @@ import MachOp
import StaticFlags
import Constants
import Outputable
import FastString
import Data.Word
\end{code}
......
......@@ -30,8 +30,6 @@ module CoreFVs (
freeVarsOf -- CoreExprWithFVs -> IdSet
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import CoreSyn
......
......@@ -39,6 +39,7 @@ import StaticFlags
import ListSetOps
import DynFlags
import Outputable
import FastString
import Util
import Data.Maybe
\end{code}
......
......@@ -35,6 +35,7 @@ import DynFlags
import Util
import Outputable
import MonadUtils
import FastString
\end{code}
-- ---------------------------------------------------------------------------
......
......@@ -43,6 +43,7 @@ import UniqSupply
import Maybes
import Outputable
import PprCore () -- Instances
import FastString
import Data.List
\end{code}
......
......@@ -11,8 +11,6 @@ module CoreTidy (
tidyExpr, tidyVarOcc, tidyRule, tidyRules
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import CoreSyn
......
......@@ -48,6 +48,7 @@ import Type
import PrelNames
import Bag
import FastTypes
import FastString
import Outputable
\end{code}
......
......@@ -15,8 +15,6 @@ Matching guarded right-hand-sides (GRHSs)
module DsGRHSs ( dsGuarded, dsGRHSs ) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import {-# SOURCE #-} DsExpr ( dsLExpr, dsLocalBinds )
......
......@@ -15,8 +15,6 @@ Desugaring list comprehensions and array comprehensions
module DsListComp ( dsListComp, dsPArrComp ) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import {-# SOURCE #-} DsExpr ( dsLExpr, dsLocalBinds )
......
......@@ -59,6 +59,7 @@ import OccName
import DynFlags
import ErrUtils
import MonadUtils
import FastString
import Data.IORef
\end{code}
......
......@@ -43,6 +43,7 @@ import Maybes
import Util
import Name
import Outputable
import FastString
\end{code}
This function is a wrapper of @match@, it must be called from all the parts where
......
......@@ -15,8 +15,6 @@ Pattern-matching constructors
module MatchCon ( matchConFamily ) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import {-# SOURCE #-} Match ( match )
......
......@@ -68,6 +68,7 @@ import PrelNames
import TysWiredIn
import Outputable
import FastString
import Panic
#ifndef GHCI_TABLES_NEXT_TO_CODE
......
......@@ -35,6 +35,7 @@ import SrcLoc
import Util
import Var
import Bag
import FastString
\end{code}
%************************************************************************
......
......@@ -6,8 +6,6 @@ module HsDoc (
ppr_mbDoc
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Outputable
......
......@@ -46,6 +46,7 @@ import IfaceSyn ( IfaceBinding )
import Outputable
import SrcLoc ( Located(..) )
import Module ( Module, ModuleName )
import FastString
\end{code}
All we actually declare here is the top-level structure for a module.
......
......@@ -38,6 +38,7 @@ import BasicTypes
import SrcLoc
import StaticFlags
import Outputable
import FastString
\end{code}
......
......@@ -58,6 +58,7 @@ import Outputable
import BinIface
import Panic
import Util
import FastString
import Control.Monad
import Data.List
......
......@@ -58,8 +58,9 @@ import Maybes
import SrcLoc
import DynFlags
import Util
import Control.Monad
import FastString
import Control.Monad
import Data.List
import Data.Maybe
\end{code}
......
......@@ -14,8 +14,6 @@ module CmdLineParser (
CmdLineP(..), getCmdLineState, putCmdLineState
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Util
......
......@@ -13,8 +13,6 @@ import Data.Bits (shiftL)
-- we want; if we just hope a -I... will get the right one, we could
-- be in trouble.
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
#include "../includes/MachRegs.h"
#include "../includes/Constants.h"
......
......@@ -35,6 +35,7 @@ import Panic
import SrcLoc
import Data.List
import CmdLineParser
import FastString
import ErrUtils ( debugTraceMsg, putMsg )
......
......@@ -45,6 +45,7 @@ import Maybes ( expectJust )
import ParserCoreUtils ( getCoreModuleName )
import SrcLoc ( unLoc )
import SrcLoc ( Located(..) )
import FastString
import Control.Exception as Exception
import Data.IORef ( readIORef, writeIORef, IORef )
......
......@@ -60,8 +60,6 @@ module DynFlags (
compilerInfo,
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Module
......
......@@ -28,8 +28,6 @@ module ErrUtils (
debugTraceMsg,
) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Bag ( Bag, bagToList, isEmptyBag, emptyBag )
......
......@@ -266,6 +266,7 @@ import BasicTypes
import Maybes ( expectJust, mapCatMaybes )
import HaddockParse
import HaddockLex ( tokenise )
import FastString
import Control.Concurrent
import System.Directory ( getModificationTime, doesFileExist,
......
......@@ -6,8 +6,6 @@
\begin{code}
module HscStats ( ppSourceStats ) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import HsSyn
......
......@@ -112,7 +112,7 @@ import BreakArray
import SrcLoc ( SrcSpan, Located )
import LazyUniqFM ( lookupUFM, eltsUFM, emptyUFM )
import UniqSupply ( UniqSupply )
import FastString ( FastString )
import FastString
import StringBuffer ( StringBuffer )
import System.FilePath
......
......@@ -22,10 +22,6 @@ import Distribution.Package
import Distribution.Version
import Distribution.Compat.ReadP ( readP_to_S )
-- warning suppression
_unused :: FS.FastString
_unused = FSLIT("")
-- -----------------------------------------------------------------------------
-- Our PackageConfig type is just InstalledPackageInfo from Cabal. Later we
-- might need to extend it with some GHC-specific stuff, but for now it's fine.
......
......@@ -27,6 +27,7 @@ import TcType
import Var
import Name
import Outputable
import FastString
-- -----------------------------------------------------------------------------
-- Pretty-printing entities that we get from the GHC API
......
......@@ -75,7 +75,7 @@ module StaticFlags (
import CmdLineParser
import Config
import FastString ( FastString, mkFastString )
import FastString
import Util
import Maybes ( firstJust )
import Panic
......
......@@ -74,7 +74,7 @@ import CString ( CString, peekCString )
import System.Process ( runInteractiveProcess, getProcessExitCode )
import Control.Concurrent( forkIO, newChan, readChan, writeChan )
import FastString ( mkFastString )
import FastString
import SrcLoc ( SrcLoc, mkSrcLoc, noSrcSpan, mkSrcSpan )
\end{code}
......
......@@ -45,9 +45,6 @@ import FastBool hiding ( fastOr )
import Data.List ( partition )
import Data.Maybe ( isJust )
import Data.IORef ( IORef, readIORef, writeIORef )
_dummy :: FS.FastString
_dummy = FSLIT("")
\end{code}
......
......@@ -76,6 +76,7 @@ import qualified Outputable
import Panic ( panic )
import DynFlags
import FastString
-- The most important function here is cmmMakeDynamicReference.
......
......@@ -101,6 +101,7 @@ import UniqFM
import UniqSupply
import Outputable
import State
import FastString
import Data.Maybe
import Data.List
......
......@@ -46,6 +46,7 @@ import UniqFM
import UniqSupply
import Bag
import State
import FastString
import Data.List
import Data.Maybe
......
......@@ -26,7 +26,7 @@ module ForeignCall (
#include "HsVersions.h"
import FastString ( FastString, unpackFS )
import FastString
import Char ( isAlphaNum )
import Binary
import Outputable
......
......@@ -68,7 +68,7 @@ import SrcLoc
import Unique ( mkAlphaTyVarUnique, pprUnique )
import PrelNames
import StaticFlags
import FastString ( FastString, mkFastString )
import FastString
import Outputable
import Char ( ord, chr )
......
......@@ -25,8 +25,6 @@ This is now a sort-of-normal STG-to-STG pass (WDP 94/06), run by stg2stg.
\begin{code}
module SCCfinal ( stgMassageForProfiling ) where
-- XXX This define is a bit of a hack, and should be done more nicely
#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import StgSyn
......
......@@ -60,6 +60,7 @@ import BasicTypes ( RecFlag(..) )
import Digraph ( SCC(..), stronglyConnComp )
import Bag
import Outputable
import FastString
import Maybes ( orElse )
import Util ( filterOut )
import Monad ( foldM, unless )
......
......@@ -49,6 +49,7 @@ import ErrUtils
import BasicTypes ( DeprecTxt, Fixity )
import DriverPhases ( isHsBoot )
import Util
import FastString
import ListSetOps
import Data.List ( partition, concatMap, (\\), delete )
import IO ( openFile, IOMode(..) )
......
......@@ -49,6 +49,7 @@ import NameEnv
import LazyUniqFM
import OccName
import Outputable
import FastString
import SrcLoc ( Located(..), unLoc, noLoc )
import DynFlags ( DynFlag(..) )
import Maybe ( isNothing )
......
......@@ -31,6 +31,7 @@ import NameSet
import BasicTypes ( compareFixity, funTyFixity, negateFixity,
Fixity(..), FixityDirection(..) )
import Outputable
import FastString
#include "HsVersions.h"
\end{code}
......
......@@ -23,6 +23,7 @@ import StaticFlags ( opt_PprStyle_Debug )