[project @ 2001-10-08 13:24:53 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverFlags.hs
index e9b2a80..461a70d 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -#include "hschooks.h" #-}
 
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.66 2001/08/17 17:18:52 apt Exp $
+-- $Id: DriverFlags.hs,v 1.74 2001/10/08 13:24:53 simonmar Exp $
 --
 -- Driver flags
 --
@@ -76,8 +76,8 @@ processArgs _spec [] spare = return (reverse spare)
 
 processArgs spec args@(('-':arg):args') spare = do
   case findArg spec arg of
-    Just (rest,action) ->  do args' <- processOneArg action rest args
-                             processArgs spec args' spare
+    Just (rest,action) -> do args' <- processOneArg action rest args
+                            processArgs spec args' spare
     Nothing           -> processArgs spec args' (('-':arg):spare)
 
 processArgs spec (arg:args) spare = 
@@ -222,6 +222,7 @@ static_flags =
   ,  ( "keep-hc-file"   , AnySuffix (\_ -> writeIORef v_Keep_hc_files True) )
   ,  ( "keep-s-file"    , AnySuffix (\_ -> writeIORef v_Keep_s_files  True) )
   ,  ( "keep-raw-s-file", AnySuffix (\_ -> writeIORef v_Keep_raw_s_files  True) )
+  ,  ( "keep-il-file"   , AnySuffix (\_ -> writeIORef v_Keep_il_files True) )
   ,  ( "keep-tmp-files" , AnySuffix (\_ -> writeIORef v_Keep_tmp_files True) )
 
   ,  ( "split-objs"    , NoArg (if can_split
@@ -272,6 +273,9 @@ static_flags =
   ,  ( "fmax-simplifier-iterations", 
                Prefix (writeIORef v_MaxSimplifierIterations . read) )
 
+  ,  ( "frule-check", 
+               SepArg (\s -> writeIORef v_RuleCheck (Just s)) )
+
   ,  ( "fusagesp"         , NoArg (do writeIORef v_UsageSPInf True
                                       add v_Opt_C "-fusagesp-on") )
 
@@ -459,7 +463,8 @@ buildStaticHscOpts = do
            0 -> hsc_minusNoO_flags
            1 -> hsc_minusO_flags
            2 -> hsc_minusO2_flags
-           _ -> error "unknown opt level"
+           n -> throwDyn (CmdLineError ("unknown optimisation level: "
+                                         ++ show n))
            -- ToDo: -Ofile
  
        -- take into account -fno-* flags by removing the equivalent -f*
@@ -482,7 +487,10 @@ buildStaticHscOpts = do
 
 machdepCCOpts 
    | prefixMatch "alpha"   cTARGETPLATFORM  
-       = return ( ["-static", "-Xlinker -noprefix_recognition"], [] )
+       = return ( ["-static", "-w"], ["-mieee"] )
+       -- For now, to suppress the gcc warning "call-clobbered
+       -- register used for global register variable", we simply
+       -- disable all warnings altogether using the -w flag. Oh well.
 
    | prefixMatch "hppa"    cTARGETPLATFORM  
         -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
@@ -517,6 +525,12 @@ machdepCCOpts
    | prefixMatch "mips"    cTARGETPLATFORM
        = return ( ["-static"], [] )
 
+   | prefixMatch "sparc"    cTARGETPLATFORM
+       = return ( [], ["-w"] )
+       -- For now, to suppress the gcc warning "call-clobbered
+       -- register used for global register variable", we simply
+       -- disable all warnings altogether using the -w flag. Oh well.
+
    | prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
        = return ( ["-static"], ["-finhibit-size-directive"] )