[project @ 2001-02-27 12:36:36 by rrt]
authorrrt <unknown>
Tue, 27 Feb 2001 12:36:37 +0000 (12:36 +0000)
committerrrt <unknown>
Tue, 27 Feb 2001 12:36:37 +0000 (12:36 +0000)
Add ILX support (all #ifdefed on ILX for now) and tidied up some
indentation. We now support --mk-dll, so remove the comment about adding
that.

ghc/compiler/main/CmdLineOpts.lhs
ghc/compiler/main/CodeOutput.lhs
ghc/compiler/main/DriverPhases.hs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/Main.hs

index f3c271a..4442443 100644 (file)
@@ -348,6 +348,9 @@ data HscLang
   = HscC
   | HscAsm
   | HscJava
+#ifdef ILX
+  | HscILX
+#endif
   | HscInterpreted
     deriving (Eq, Show)
 
@@ -478,7 +481,7 @@ opt_DoSemiTagging           = lookUp  SLIT("-fsemi-tagging")
 opt_FoldrBuildOn               = lookUp  SLIT("-ffoldr-build-on")
 opt_LiberateCaseThreshold      = lookup_def_int "-fliberate-case-threshold" (10::Int)
 opt_StgDoLetNoEscapes          = lookUp  SLIT("-flet-no-escape")
-opt_UnfoldCasms                        = lookUp SLIT("-funfold-casms-in-hi-file")
+opt_UnfoldCasms                        = lookUp  SLIT("-funfold-casms-in-hi-file")
 opt_UsageSPOn                  = lookUp  SLIT("-fusagesp-on")
 opt_UnboxStrictFields          = lookUp  SLIT("-funbox-strict-fields")
 
@@ -504,13 +507,13 @@ opt_OmitInterfacePragmas  = lookUp  SLIT("-fomit-interface-pragmas")
 opt_KeepStgTypes               = lookUp  SLIT("-fkeep-stg-types")
 
 -- Simplifier switches
-opt_SimplNoPreInlining         = lookUp SLIT("-fno-pre-inlining")
+opt_SimplNoPreInlining         = lookUp  SLIT("-fno-pre-inlining")
        -- NoPreInlining is there just to see how bad things
        -- get if you don't do it!
-opt_SimplDoEtaReduction                = lookUp SLIT("-fdo-eta-reduction")
-opt_SimplDoLambdaEtaExpansion  = lookUp SLIT("-fdo-lambda-eta-expansion")
-opt_SimplCaseMerge             = lookUp SLIT("-fcase-merge")
-opt_SimplExcessPrecision       = lookUp SLIT("-fexcess-precision")
+opt_SimplDoEtaReduction                = lookUp  SLIT("-fdo-eta-reduction")
+opt_SimplDoLambdaEtaExpansion  = lookUp  SLIT("-fdo-lambda-eta-expansion")
+opt_SimplCaseMerge             = lookUp  SLIT("-fcase-merge")
+opt_SimplExcessPrecision       = lookUp  SLIT("-fexcess-precision")
 
 -- Unfolding control
 opt_UF_HiFileThreshold         = lookup_def_int "-funfolding-interface-threshold" (45::Int)
@@ -523,10 +526,10 @@ opt_UF_UpdateInPlace              = lookUp  SLIT("-funfolding-update-in-place")
 opt_UF_CheapOp  = ( 1 :: Int)  -- Only one instruction; and the args are charged for
 opt_UF_DearOp   = ( 4 :: Int)
                        
-opt_NoPruneDecls               = lookUp SLIT("-fno-prune-decls")
-opt_NoPruneTyDecls             = lookUp SLIT("-fno-prune-tydecls")
-opt_Static                     = lookUp SLIT("-static")
-opt_Unregisterised             = lookUp SLIT("-funregisterised")
+opt_NoPruneDecls               = lookUp  SLIT("-fno-prune-decls")
+opt_NoPruneTyDecls             = lookUp  SLIT("-fno-prune-tydecls")
+opt_Static                     = lookUp  SLIT("-static")
+opt_Unregisterised             = lookUp  SLIT("-funregisterised")
 \end{code}
 
 %************************************************************************
index 3335b89..fc4cd8d 100644 (file)
@@ -73,6 +73,9 @@ codeOutput dflags mod_name tycons core_binds stg_binds
                               >> return stub_names
              HscJava        -> outputJava dflags filenm mod_name tycons core_binds
                               >> return stub_names
+#ifdef ILX
+            HscILX         -> outputIlx mod_name tycons stg_binds
+#endif
        }
 
 doOutput :: String -> (Handle -> IO ()) -> IO ()
@@ -146,6 +149,22 @@ outputJava dflags filenm mod tycons core_binds
 
 %************************************************************************
 %*                                                                     *
+\subsection{Ilx}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+#ifdef ILX
+outputIlx mod tycons stg_binds
+  =  doOutput (\ f -> printForC f pp_ilx)
+  where
+    pp_ilx = ilxGen mod tycons stg_binds
+#endif
+\end{code}
+
+
+%************************************************************************
+%*                                                                     *
 \subsection{Foreign import/export}
 %*                                                                     *
 %************************************************************************
index 80c2b44..3a7053f 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverPhases.hs,v 1.4 2001/01/03 11:13:43 simonmar Exp $
+-- $Id: DriverPhases.hs,v 1.5 2001/02/27 12:36:37 rrt Exp $
 --
 -- GHC Driver
 --
@@ -42,6 +42,9 @@ data Phase
        | Hsc
        | Cc
        | HCc           -- Haskellised C (as opposed to vanilla C) compilation
+#ifdef ILX
+       | Ilx           -- .NET extended IL
+#endif
        | Mangle        -- assembly mangling, now done by a separate script.
        | SplitMangle   -- after mangler if splitting
        | SplitAs
@@ -69,6 +72,9 @@ phaseInputExt Cpp         = "lpp"     -- intermediate only
 phaseInputExt Hsc         = "hspp"
 phaseInputExt HCc         = "hc"
 phaseInputExt Cc          = "c"
+#ifdef ILX
+phaseInputExt Ilx         = "ilx"
+#endif
 phaseInputExt Mangle      = "raw_s"
 phaseInputExt SplitMangle = "split_s"  -- not really generated
 phaseInputExt As          = "s"
index c0e5896..079ff72 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.51 2001/02/26 15:50:21 simonmar Exp $
+-- $Id: DriverPipeline.hs,v 1.52 2001/02/27 12:36:37 rrt Exp $
 --
 -- GHC Driver
 --
@@ -185,6 +185,10 @@ genPipeline todo stop_flag persistent_output lang filename
 
        HscJava | split           -> not_valid
                | otherwise       -> error "not implemented: compiling via Java"
+#ifdef ILX
+       HscILX  | split           -> not_valid
+               | otherwise       -> [ Unlit, Cpp, Hsc ]
+#endif
 
       | cish      = [ Cc, As ]
 
@@ -879,6 +883,9 @@ compile ghci_mode summary source_unchanged old_iface hst hit pcs = do
                    HscAsm         -> newTempName (phaseInputExt As)
                    HscC           -> newTempName (phaseInputExt HCc)
                    HscJava        -> newTempName "java" -- ToDo
+#ifdef ILX
+                   HscILX         -> newTempName (phaseInputExt Ilx)
+#endif
                    HscInterpreted -> return (error "no output file")
 
    -- run the compiler
index df50f1c..9ebd0d7 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -fno-warn-incomplete-patterns #-}
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.54 2001/02/20 11:04:42 simonmar Exp $
+-- $Id: Main.hs,v 1.55 2001/02/27 12:36:37 rrt Exp $
 --
 -- GHC Driver program
 --
@@ -67,7 +67,6 @@ import Maybe
 -- new mkdependHS doesn't support all the options that the old one did (-X et al.)
 -- time commands when run with -v
 -- split marker
--- mkDLL
 -- java generation
 -- user ways
 -- Win32 support: proper signal handling