{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.81 2001/12/10 01:28:00 sebc Exp $
+-- $Id: DriverFlags.hs,v 1.82 2001/12/10 14:08:14 simonmar Exp $
--
-- Driver flags
--
-- -fno-* pattern below doesn't work. We therefore allow
-- certain optimisation passes to be turned off explicitly:
, ( "fno-strictness" , NoArg (writeIORef v_Strictness False) )
+#ifdef DEBUG
, ( "fno-cpr" , NoArg (writeIORef v_CPR False) )
+#endif
, ( "fno-cse" , NoArg (writeIORef v_CSE False) )
-- All other "-fno-<blah>" options cancel out "-f<blah>" on the hsc cmdline
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.62 2001/12/05 00:08:27 sof Exp $
+-- $Id: DriverState.hs,v 1.63 2001/12/10 14:08:14 simonmar Exp $
--
-- Settings for the driver
--
GLOBAL_VAR(v_StgStats, False, Bool)
GLOBAL_VAR(v_UsageSPInf, False, Bool) -- Off by default
GLOBAL_VAR(v_Strictness, True, Bool)
+#ifdef DEBUG
GLOBAL_VAR(v_CPR, True, Bool)
+#endif
GLOBAL_VAR(v_CSE, True, Bool)
GLOBAL_VAR(v_RuleCheck, Nothing, Maybe String)
max_iter <- readIORef v_MaxSimplifierIterations
usageSP <- readIORef v_UsageSPInf
strictness <- readIORef v_Strictness
+#ifdef DEBUG
cpr <- readIORef v_CPR
+#endif
cse <- readIORef v_CSE
rule_check <- readIORef v_RuleCheck
],
case rule_check of { Just pat -> CoreDoRuleCheck 0 pat; Nothing -> CoreDoNothing },
+#ifdef DEBUG
if cpr then CoreDoCPResult else CoreDoNothing,
+#endif
if strictness then CoreDoStrictness else CoreDoNothing,
CoreDoWorkerWrapper,
CoreDoGlomBinds,
addToDirList ref path
= do paths <- readIORef ref
shiny_new_ones <- splitUp path
- writeIORef ref (paths ++ shiny_new_ones)
-
+ writeIORef ref (paths ++ filter (not.null) shiny_new_ones)
+ -- empty paths are ignored: there might be a trailing
+ -- ':' in the initial list, for example. Empty paths can
+ -- cause confusion when they are translated into -I options
+ -- for passing to gcc.
where
splitUp ::String -> IO [String]
#ifdef mingw32_TARGET_OS