Move OPTIONS pragmas above comments
[ghc-hetmet.git] / compiler / main / DynFlags.hs
index c3b1d61..2062ed1 100644 (file)
@@ -1,5 +1,12 @@
 
 {-# OPTIONS -fno-warn-missing-fields #-}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
+
 -----------------------------------------------------------------------------
 --
 -- Dynamic flags
@@ -84,7 +91,7 @@ import Data.List      ( isPrefixOf )
 import Util            ( split )
 #endif
 
-import Data.Char       ( isUpper, toLower )
+import Data.Char       ( isUpper )
 import System.IO        ( hPutStrLn, stderr )
 
 -- -----------------------------------------------------------------------------
@@ -94,7 +101,10 @@ data DynFlag
 
    -- debugging flags
    = Opt_D_dump_cmm
+   | Opt_D_dump_cmmz
+   | Opt_D_dump_cmmz_pretty
    | Opt_D_dump_cps_cmm
+   | Opt_D_dump_cvt_cmm
    | Opt_D_dump_asm
    | Opt_D_dump_asm_native
    | Opt_D_dump_asm_liveness
@@ -146,6 +156,7 @@ data DynFlag
    | Opt_DoCoreLinting
    | Opt_DoStgLinting
    | Opt_DoCmmLinting
+   | Opt_DoAsmLinting
 
    | Opt_WarnIsError                   -- -Werror; makes warnings fatal
    | Opt_WarnDuplicateExports
@@ -213,7 +224,7 @@ data DynFlag
    | Opt_GeneralizedNewtypeDeriving
    | Opt_RecursiveDo
    | Opt_PatternGuards
-   | Opt_PartiallyAppliedClosedTypeSynonyms
+   | Opt_LiberalTypeSynonyms
    | Opt_Rank2Types
    | Opt_RankNTypes
    | Opt_TypeOperators
@@ -237,7 +248,8 @@ data DynFlag
    | Opt_DictsCheap
    | Opt_RewriteRules
    | Opt_Vectorise
-   | Opt_RegsGraph
+   | Opt_RegsGraph                     -- do graph coloring register allocation
+   | Opt_RegsIterative                 -- do iterative coalescing graph coloring register allocation
 
    -- misc opts
    | Opt_Cpp
@@ -255,8 +267,12 @@ data DynFlag
    | Opt_Haddock
    | Opt_Hpc_No_Auto
    | Opt_BreakOnException
+   | Opt_BreakOnError
+   | Opt_PrintEvldWithShow
    | Opt_GenManifest
    | Opt_EmbedManifest
+   | Opt_RunCPSZ
+   | Opt_ConvertToZipCfgAndBack
 
    -- keeping stuff
    | Opt_KeepHiDiffs
@@ -1019,7 +1035,10 @@ dynamic_flags = [
   ,  ( "dstg-stats",   NoArg (setDynFlag Opt_StgStats))
 
   ,  ( "ddump-cmm",             setDumpFlag Opt_D_dump_cmm)
+  ,  ( "ddump-cmmz",            setDumpFlag Opt_D_dump_cmmz)
+  ,  ( "ddump-cmmz-pretty",      setDumpFlag Opt_D_dump_cmmz_pretty)
   ,  ( "ddump-cps-cmm",                 setDumpFlag Opt_D_dump_cps_cmm)
+  ,  ( "ddump-cvt-cmm",                 setDumpFlag Opt_D_dump_cvt_cmm)
   ,  ( "ddump-asm",             setDumpFlag Opt_D_dump_asm)
   ,  ( "ddump-asm-native",       setDumpFlag Opt_D_dump_asm_native)
   ,  ( "ddump-asm-liveness",     setDumpFlag Opt_D_dump_asm_liveness)
@@ -1071,6 +1090,7 @@ dynamic_flags = [
   ,  ( "dcore-lint",            NoArg (setDynFlag Opt_DoCoreLinting))
   ,  ( "dstg-lint",             NoArg (setDynFlag Opt_DoStgLinting))
   ,  ( "dcmm-lint",             NoArg (setDynFlag Opt_DoCmmLinting))
+  ,  ( "dasm-lint",              NoArg (setDynFlag Opt_DoAsmLinting))
   ,  ( "dshow-passes",           NoArg (do setDynFlag Opt_ForceRecomp
                                           setVerbosity (Just 2)) )
   ,  ( "dfaststring-stats",     NoArg (setDynFlag Opt_D_faststring_stats))
@@ -1081,12 +1101,13 @@ dynamic_flags = [
   ,  ( "monly-3-regs",         NoArg (upd (\s -> s{stolen_x86_regs = 3}) ))
   ,  ( "monly-4-regs",         NoArg (upd (\s -> s{stolen_x86_regs = 4}) ))
 
-       ------ Warning opts -------------------------------------------------
-  ,  ( "W"             , NoArg (mapM_ setDynFlag   minusWOpts)    )
-  ,  ( "Werror"                , NoArg (setDynFlag         Opt_WarnIsError) )
-  ,  ( "Wall"          , NoArg (mapM_ setDynFlag   minusWallOpts) )
-  ,  ( "Wnot"          , NoArg (mapM_ unSetDynFlag minusWallOpts) ) /* DEPREC */
-  ,  ( "w"             , NoArg (mapM_ unSetDynFlag minuswRemovesOpts) )
+     ------ Warning opts -------------------------------------------------
+  ,  ( "W"     , NoArg (mapM_ setDynFlag   minusWOpts)    )
+  ,  ( "Werror", NoArg (setDynFlag         Opt_WarnIsError) )
+  ,  ( "Wwarn" , NoArg (unSetDynFlag       Opt_WarnIsError) )
+  ,  ( "Wall"  , NoArg (mapM_ setDynFlag   minusWallOpts) )
+  ,  ( "Wnot"  , NoArg (mapM_ unSetDynFlag minusWallOpts) ) -- DEPRECATED
+  ,  ( "w"     , NoArg (mapM_ unSetDynFlag minuswRemovesOpts) )
 
        ------ Optimisation flags ------------------------------------------
   ,  ( "O"     , NoArg (upd (setOptLevel 1)))
@@ -1175,8 +1196,13 @@ fFlags = [
   ( "hpc-no-auto",                      Opt_Hpc_No_Auto ),
   ( "rewrite-rules",                    Opt_RewriteRules ),
   ( "break-on-exception",               Opt_BreakOnException ),
+  ( "break-on-error",                   Opt_BreakOnError ),
+  ( "print-evld-with-show",             Opt_PrintEvldWithShow ),
+  ( "run-cps",                          Opt_RunCPSZ ),
+  ( "convert-to-zipper-and-back",       Opt_ConvertToZipCfgAndBack),
   ( "vectorise",                        Opt_Vectorise ),
   ( "regs-graph",                       Opt_RegsGraph),
+  ( "regs-iterative",                   Opt_RegsIterative),
   -- Deprecated in favour of -XTemplateHaskell:
   ( "th",                               Opt_TemplateHaskell ),
   -- Deprecated in favour of -XForeignFunctionInterface:
@@ -1231,8 +1257,7 @@ xFlags = [
   ( "ParallelListComp",                 Opt_ParallelListComp ),
   ( "ForeignFunctionInterface",         Opt_ForeignFunctionInterface ),
   ( "UnliftedFFITypes",                 Opt_UnliftedFFITypes ),
-  ( "PartiallyAppliedClosedTypeSynonyms",
-    Opt_PartiallyAppliedClosedTypeSynonyms ),
+  ( "LiberalTypeSynonyms",             Opt_LiberalTypeSynonyms ),
   ( "Rank2Types",                       Opt_Rank2Types ),
   ( "RankNTypes",                       Opt_RankNTypes ),
   ( "TypeOperators",                    Opt_TypeOperators ),
@@ -1299,7 +1324,7 @@ glasgowExtsFlags = [
            , Opt_ExistentialQuantification
            , Opt_UnicodeSyntax
            , Opt_PatternGuards
-           , Opt_PartiallyAppliedClosedTypeSynonyms
+           , Opt_LiberalTypeSynonyms
            , Opt_RankNTypes
            , Opt_TypeOperators
            , Opt_RecursiveDo
@@ -1682,10 +1707,13 @@ compilerInfo = [("Project name",                cProjectName),
                 ("Booter version",              cBooterVersion),
                 ("Stage",                       cStage),
                 ("Interface file version",      cHscIfaceFileVersion),
+                ("Have interpreter",            cGhcWithInterpreter),
                 ("Object splitting",            cSplitObjs),
                 ("Have native code generator",  cGhcWithNativeCodeGen),
+                ("Support SMP",                 cGhcWithSMP),
                 ("Unregisterised",              cGhcUnregisterised),
                 ("Tables next to code",         cGhcEnableTablesNextToCode),
                 ("Win32 DLLs",                  cEnableWin32DLLs),
+                ("RTS ways",                    cGhcRTSWays),
                 ("Leading underscore",          cLeadingUnderscore)]