Final changes to get it to compile.
\section[CompManager]{The Compilation Manager}
\begin{code}
+#if 1
+module CompManager ( )
+where
+the_answer = "42"
+
+#else
+
module CompManager ( cmInit, cmLoadModule,
cmGetExpr, cmRunExpr,
CmState, emptyCmState -- abstract
if null newHomeSummaries
then return homeSummaries
else loop (newHomeSummaries ++ homeSummaries)
-
+#endif
\end{code}
DynFlag(..), -- needed non-abstractly by DriverFlags
DynFlags(..),
+ v_Static_hsc_opts,
+
intSwitchSet,
switchIsOn,
isStaticHscFlag,
import Array ( array, (//) )
import GlaExts
+import IOExts ( IORef, readIORef )
import Argv
import Constants -- Default values for some flags
import Util
%************************************************************************
\begin{code}
+-- v_Statis_hsc_opts is here to avoid a circular dependency with
+-- main/DriverState.
+GLOBAL_VAR(v_Static_hsc_opts, [], [String])
+
lookUp :: FAST_STRING -> Bool
lookup_int :: String -> Maybe Int
lookup_def_int :: String -> Int -> Int
lookup_def_float :: String -> Float -> Float
lookup_str :: String -> Maybe String
-lookUp sw = sw `elem` argv
+unpacked_static_opts = unsafePerformIO (readIORef v_Static_hsc_opts)
+packed_static_opts = map _PK_ unpacked_static_opts
+
+lookUp sw = sw `elem` packed_static_opts
-lookup_str sw = firstJust (map (startsWith sw) unpacked_opts)
+lookup_str sw = firstJust (map (startsWith sw) unpacked_static_opts)
lookup_int sw = case (lookup_str sw) of
Nothing -> Nothing
Nothing -> def -- Use default
Just xx -> read xx
-unpacked_opts = map _UNPK_ argv
{-
Putting the compiler options into temporary at-files
unpacked_opts =
concat $
map (expandAts) $
- map _UNPK_ argv
+ map _UNPK_ argv -- NOT ARGV any more: v_Static_hsc_opts
where
expandAts ('@':fname) = words (unsafePerformIO (readFile fname))
expandAts l = [l]
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.7 2000/10/26 16:21:02 sewardj Exp $
+-- $Id: DriverState.hs,v 1.8 2000/10/26 16:51:44 sewardj Exp $
--
-- Settings for the driver
--
-----------------------------------------------------------------------------
-- Global compilation flags
-GLOBAL_VAR(v_Static_hsc_opts, [], [String])
-
-- location of compiler-related files
GLOBAL_VAR(v_TopDir, clibdir, String)
GLOBAL_VAR(v_Inplace, False, Bool)
{-# OPTIONS -W -fno-warn-incomplete-patterns #-}
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.10 2000/10/26 16:21:02 sewardj Exp $
+-- $Id: Main.hs,v 1.11 2000/10/26 16:51:44 sewardj Exp $
--
-- GHC Driver program
--
import DriverMkDepend
import DriverUtil
import DriverPhases ( Phase(..) )
-import CmdLineOpts ( HscLang(..), DynFlags(..) )
+import CmdLineOpts ( HscLang(..), DynFlags(..), v_Static_hsc_opts )
import TmpFiles
import Config
import Util
import System
import Maybe
+import CompManager
+
-----------------------------------------------------------------------------
-- Changes:
{-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.44 2000/10/24 13:23:33 sewardj Exp $
+$Id: Parser.y,v 1.45 2000/10/26 16:51:44 sewardj Exp $
Haskell grammar.
module Parser ( parse ) where
import HsSyn
-import HsPragmas
import HsTypes ( mkHsTupCon )
import HsPat ( InPat(..) )