Commit 950c1eca authored by simonmar's avatar simonmar
Browse files

[project @ 2002-03-13 13:51:34 by simonmar]

Fix the -fasm/-fvia-C auto-selection again: now we're back to the
proper behaviour, namely -fasm is the default unless you specify -O or
-fvia-C, but only on arch's that support it.

I screwed it up in the previous commit, but it exposed a bug in the
NCG so it wasn't all bad :)
parent ddd68e60
......@@ -20,6 +20,7 @@ module CmdLineOpts (
-- Manipulating DynFlags
defaultDynFlags, -- DynFlags
defaultHscLang, -- HscLang
dopt, -- DynFlag -> DynFlags -> Bool
dopt_set, dopt_unset, -- DynFlags -> DynFlag -> DynFlags
dopt_CoreToDo, -- DynFlags -> [CoreToDo]
......@@ -335,9 +336,15 @@ data HscLang
| HscNothing
deriving (Eq, Show)
defaultHscLang
| cGhcWithNativeCodeGen == "YES" &&
(prefixMatch "i386" cTARGETPLATFORM ||
prefixMatch "sparc" cTARGETPLATFORM) = HscAsm
| otherwise = HscC
defaultDynFlags = DynFlags {
coreToDo = [], stgToDo = [],
hscLang = HscC,
hscLang = defaultHscLang,
hscOutName = "",
hscStubHOutName = "", hscStubCOutName = "",
extCoreName = "",
......
-----------------------------------------------------------------------------
-- $Id: DriverState.hs,v 1.70 2002/02/16 18:15:14 sof Exp $
-- $Id: DriverState.hs,v 1.71 2002/03/13 13:51:35 simonmar Exp $
--
-- Settings for the driver
--
......@@ -121,12 +121,6 @@ can_split = prefixMatch "i386" cTARGETPLATFORM
-----------------------------------------------------------------------------
-- Compiler output options
defaultHscLang
| cGhcWithNativeCodeGen == "YES" &&
(prefixMatch "i386" cTARGETPLATFORM ||
prefixMatch "sparc" cTARGETPLATFORM) = HscAsm
| otherwise = HscC
GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
......
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
-----------------------------------------------------------------------------
-- $Id: Main.hs,v 1.99 2002/03/12 16:45:59 simonmar Exp $
-- $Id: Main.hs,v 1.100 2002/03/13 13:51:35 simonmar Exp $
--
-- GHC Driver program
--
......@@ -30,7 +30,7 @@ import SysTools ( getPackageConfigPath, initSysTools, cleanTempFiles )
import Packages ( showPackages )
import DriverPipeline ( doLink, doMkDLL, genPipeline, pipeLoop )
import DriverState ( buildCoreToDo, buildStgToDo, defaultHscLang,
import DriverState ( buildCoreToDo, buildStgToDo,
findBuildTag, getPackageInfo, unregFlags,
v_GhcMode, v_GhcModeFlag, GhcMode(..),
v_Cmdline_libraries, v_Keep_tmp_files, v_Ld_inputs,
......@@ -48,7 +48,8 @@ import DriverUtil ( add, handle, handleDyn, later, splitFilename,
unknownFlagErr, getFileSuffix )
import CmdLineOpts ( dynFlag, restoreDynFlags,
saveDynFlags, setDynFlags, getDynFlags, dynFlag,
DynFlags(..), HscLang(..), v_Static_hsc_opts
DynFlags(..), HscLang(..), v_Static_hsc_opts,
defaultHscLang
)
import Outputable
import Util
......@@ -194,7 +195,7 @@ main =
dyn_flags <- getDynFlags
let lang = case mode of
DoInteractive -> HscInterpreted
_other -> defaultHscLang
_other -> hscLang dyn_flags
setDynFlags (dyn_flags{ coreToDo = core_todo,
stgToDo = stg_todo,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment