X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fmain%2FDynFlags.hs;h=13a5cba62708f8623d24b55f19ce29317a76d0cd;hb=7fc749a43b4b6b85d234fa95d4928648259584f4;hp=10924bdb0a1dccdabf8180af70b276b7f8eb164d;hpb=eb4352ab0675309fe6cb1ad38cf070340a338e50;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 10924bd..13a5cba 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -13,6 +13,13 @@ -- ----------------------------------------------------------------------------- +{-# 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 + module DynFlags ( -- Dynamic flags DynFlag(..), @@ -54,7 +61,7 @@ module DynFlags ( #include "HsVersions.h" -import Module ( Module, mkModuleName, mkModule ) +import Module ( Module, mkModuleName, mkModule, ModLocation ) import PackageConfig import PrelNames ( mAIN ) #ifdef i386_TARGET_ARCH @@ -102,6 +109,7 @@ data DynFlag | Opt_D_dump_asm_regalloc | Opt_D_dump_asm_regalloc_stages | Opt_D_dump_asm_conflicts + | Opt_D_dump_asm_stats | Opt_D_dump_cpranal | Opt_D_dump_deriv | Opt_D_dump_ds @@ -141,11 +149,12 @@ data DynFlag | Opt_D_dump_minimal_imports | Opt_D_dump_mod_cycles | Opt_D_faststring_stats + | Opt_DumpToFile -- ^ Append dump output to files instead of stdout. | Opt_DoCoreLinting | Opt_DoStgLinting | Opt_DoCmmLinting - | Opt_WarnIsError -- -Werror; makes warnings fatal + | Opt_WarnIsError -- -Werror; makes warnings fatal | Opt_WarnDuplicateExports | Opt_WarnHiShadows | Opt_WarnImplicitPrelude @@ -263,7 +272,7 @@ data DynFlag | Opt_KeepRawSFiles | Opt_KeepTmpFiles - deriving (Eq) + deriving (Eq, Show) data DynFlags = DynFlags { ghcMode :: GhcMode, @@ -306,6 +315,14 @@ data DynFlags = DynFlags { outputFile :: Maybe String, outputHi :: Maybe String, + -- | This is set by DriverPipeline.runPipeline based on where + -- its output is going. + dumpPrefix :: Maybe FilePath, + + -- | Override the dumpPrefix set by runPipeline. + -- Set by -ddump-file-prefix + dumpPrefixForce :: Maybe FilePath, + includePaths :: [String], libraryPaths :: [String], frameworkPaths :: [String], -- used on darwin only @@ -465,6 +482,8 @@ defaultDynFlags = outputFile = Nothing, outputHi = Nothing, + dumpPrefix = Nothing, + dumpPrefixForce = Nothing, includePaths = [], libraryPaths = [], frameworkPaths = [], @@ -557,6 +576,8 @@ setHcSuf f d = d{ hcSuf = f} setOutputFile f d = d{ outputFile = f} setOutputHi f d = d{ outputHi = f} +setDumpPrefixForce f d = d { dumpPrefixForce = f} + -- XXX HACK: Prelude> words "'does not' work" ===> ["'does","not'","work"] -- Config.hs should really use Option. setPgmP f d = let (pgm:args) = words f in d{ pgm_P = (pgm, map Option args)} @@ -960,6 +981,7 @@ dynamic_flags = [ , ( "hidir" , HasArg (upd . setHiDir . Just)) , ( "tmpdir" , HasArg (upd . setTmpDir)) , ( "stubdir" , HasArg (upd . setStubDir . Just)) + , ( "ddump-file-prefix", HasArg (upd . setDumpPrefixForce . Just)) ------- Keeping temporary files ------------------------------------- -- These can be singular (think ghc -c) or plural (think ghc --make) @@ -1013,6 +1035,7 @@ dynamic_flags = [ , ( "ddump-asm-conflicts", setDumpFlag Opt_D_dump_asm_conflicts) , ( "ddump-asm-regalloc-stages", setDumpFlag Opt_D_dump_asm_regalloc_stages) + , ( "ddump-asm-stats", setDumpFlag Opt_D_dump_asm_stats) , ( "ddump-cpranal", setDumpFlag Opt_D_dump_cpranal) , ( "ddump-deriv", setDumpFlag Opt_D_dump_deriv) , ( "ddump-ds", setDumpFlag Opt_D_dump_ds) @@ -1050,7 +1073,7 @@ dynamic_flags = [ , ( "ddump-vect", setDumpFlag Opt_D_dump_vect) , ( "ddump-hpc", setDumpFlag Opt_D_dump_hpc) , ( "ddump-mod-cycles", setDumpFlag Opt_D_dump_mod_cycles) - + , ( "ddump-to-file", setDumpFlag Opt_DumpToFile) , ( "ddump-hi-diffs", NoArg (setDynFlag Opt_D_dump_hi_diffs)) , ( "dcore-lint", NoArg (setDynFlag Opt_DoCoreLinting)) , ( "dstg-lint", NoArg (setDynFlag Opt_DoStgLinting)) @@ -1666,10 +1689,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)]