[project @ 2001-09-14 16:01:20 by sewardj]
[ghc-hetmet.git] / ghc / compiler / main / DriverState.hs
index 8dae078..c192cad 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.55 2001/08/15 09:58:00 sewardj Exp $
+-- $Id: DriverState.hs,v 1.57 2001/09/14 15:51:42 simonpj Exp $
 --
 -- Settings for the driver
 --
@@ -149,6 +149,7 @@ GLOBAL_VAR(v_UsageSPInf,            False, Bool)  -- Off by default
 GLOBAL_VAR(v_Strictness,               True,  Bool)
 GLOBAL_VAR(v_CPR,                      True,  Bool)
 GLOBAL_VAR(v_CSE,                      True,  Bool)
+GLOBAL_VAR(v_RuleCheck,                Nothing,  Maybe String)
 
 -- these are the static flags you get without -O.
 hsc_minusNoO_flags =
@@ -188,6 +189,7 @@ buildCoreToDo = do
    strictness <- readIORef v_Strictness
    cpr        <- readIORef v_CPR
    cse        <- readIORef v_CSE
+   rule_check <- readIORef v_RuleCheck
 
    if opt_level == 0 then return
       [
@@ -308,7 +310,9 @@ buildCoreToDo = do
        CoreDoSimplify (isAmongSimpl [
          MaxSimplifierIterations max_iter
                -- No -finline-phase: allow all Ids to be inlined now
-       ])
+       ]),
+
+       case rule_check of { Just pat -> CoreDoRuleCheck pat; Nothing -> CoreDoNothing }
      ]
 
 buildStgToDo :: IO [ StgToDo ]
@@ -474,13 +478,18 @@ getPackageLibraries = do
      -- different route (in InteractiveUI.linkPackage).
      -- See driver/PackageSrc.hs for the HSstd1/HSstd2 split definition.
      -- THIS IS A STRICTLY TEMPORARY HACK (famous last words ...)
+     -- JRS 04 Sept 01: Same appalling hack for HSwin32[1,2]
      hACK libs
 #      ifndef mingw32_TARGET_OS
        = libs
 #      else
        = if   "HSstd1" `elem` libs && "HSstd2" `elem` libs
          then "HSstd" : filter ((/= "HSstd").(take 5)) libs
-         else libs
+         else
+         if   "HSwin321" `elem` libs && "HSwin322" `elem` libs
+         then "HSwin32" : filter ((/= "HSwin32").(take 7)) libs
+         else 
+         libs
 #      endif
 
 getPackageExtraGhcOpts :: IO [String]