[project @ 2000-05-08 15:03:24 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / CmdLineOpts.lhs
index cf2655c..ccaeac8 100644 (file)
@@ -133,11 +133,9 @@ module CmdLineOpts (
        opt_NoImplicitPrelude,
        opt_OmitBlackHoling,
        opt_OmitInterfacePragmas,
-       opt_ProduceC,
        opt_ProduceExportCStubs,
        opt_ProduceExportHStubs,
        opt_ProduceHi,
-       opt_ProduceS,
        opt_NoPruneDecls,
        opt_ReportCompile,
        opt_SourceUnchanged,
@@ -145,6 +143,9 @@ module CmdLineOpts (
        opt_Unregisterised,
        opt_Verbose,
 
+       opt_OutputLanguage,
+       opt_OutputFile,
+
        -- Code generation
        opt_UseVanillaRegs,
        opt_UseFloatRegs,
@@ -412,11 +413,20 @@ opt_NoHiCheck                   = lookUp  SLIT("-fno-hi-version-check")
 opt_NoImplicitPrelude          = lookUp  SLIT("-fno-implicit-prelude")
 opt_OmitBlackHoling            = lookUp  SLIT("-dno-black-holing")
 opt_OmitInterfacePragmas       = lookUp  SLIT("-fomit-interface-pragmas")
-opt_ProduceC                   = lookup_str "-C="
 opt_ProduceExportCStubs                = lookup_str "-F="
 opt_ProduceExportHStubs                = lookup_str "-FH="
 opt_ProduceHi                  = lookup_str "-hifile=" -- the one to produce this time 
 
+-- Language for output: "C", "asm", "java", maybe more
+-- Nothing => don't output anything
+opt_OutputLanguage :: Maybe String
+opt_OutputLanguage = lookup_str "-olang="
+
+opt_OutputFile :: String
+opt_OutputFile            = case lookup_str "-ofile=" of
+                       Nothing -> panic "No output file specified (-ofile=xxx)"
+                       Just f  -> f
+
 -- Simplifier switches
 opt_SimplNoPreInlining         = lookUp SLIT("-fno-pre-inlining")
        -- NoPreInlining is there just to see how bad things
@@ -439,7 +449,6 @@ opt_UF_KeenessFactor                = lookup_def_float "-funfolding-keeness-factor"    (1.5::F
 opt_UF_CheapOp  = ( 1 :: Int)  -- Only one instruction; and the args are charged for
 opt_UF_DearOp   = ( 4 :: Int)
                        
-opt_ProduceS                   = lookup_str "-S="
 opt_ReportCompile               = lookUp SLIT("-freport-compile")
 opt_NoPruneDecls               = lookUp SLIT("-fno-prune-decls")
 opt_SourceUnchanged            = lookUp SLIT("-fsource-unchanged")