- Dynamicise another couple of options (-fgenerics & -freport-compile)
The rest look awkward to move into DynFlags.
- Move opt_UseVanillaRegs & friends to CgRetConv, since they aren't
real options.
%
% (c) The GRASP Project, Glasgow University, 1992-1998
%
%
% (c) The GRASP Project, Glasgow University, 1992-1998
%
-% $Id: CgRetConv.lhs,v 1.27 2000/10/12 15:17:08 sewardj Exp $
+% $Id: CgRetConv.lhs,v 1.28 2000/10/18 09:40:17 simonmar Exp $
%
\section[CgRetConv]{Return conventions for the code generator}
%
\section[CgRetConv]{Return conventions for the code generator}
import AbsCSyn -- quite a few things
import Constants ( mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
mAX_Vanilla_REG, mAX_Float_REG,
import AbsCSyn -- quite a few things
import Constants ( mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
mAX_Vanilla_REG, mAX_Float_REG,
- mAX_Double_REG, mAX_Long_REG
- )
-import CmdLineOpts ( opt_UseVanillaRegs, opt_UseFloatRegs,
- opt_UseDoubleRegs, opt_UseLongRegs
+ mAX_Double_REG, mAX_Long_REG,
+ mAX_Real_Vanilla_REG, mAX_Real_Float_REG,
+ mAX_Real_Double_REG, mAX_Real_Long_REG
+import CmdLineOpts ( opt_Unregisterised )
import Maybes ( catMaybes )
import PrimRep ( isFloatingRep, PrimRep(..), is64BitRep )
import TyCon ( TyCon, tyConFamilySize )
import Maybes ( catMaybes )
import PrimRep ( isFloatingRep, PrimRep(..), is64BitRep )
import TyCon ( TyCon, tyConFamilySize )
that are guaranteed to map to machine registers.
\begin{code}
that are guaranteed to map to machine registers.
\begin{code}
+useVanillaRegs | opt_Unregisterised = 0
+ | otherwise = mAX_Real_Vanilla_REG
+useFloatRegs | opt_Unregisterised = 0
+ | otherwise = mAX_Real_Float_REG
+useDoubleRegs | opt_Unregisterised = 0
+ | otherwise = mAX_Real_Double_REG
+useLongRegs | opt_Unregisterised = 0
+ | otherwise = mAX_Real_Long_REG
+
vanillaRegNos, floatRegNos, doubleRegNos, longRegNos :: [Int]
vanillaRegNos, floatRegNos, doubleRegNos, longRegNos :: [Int]
-vanillaRegNos = regList opt_UseVanillaRegs
-floatRegNos = regList opt_UseFloatRegs
-doubleRegNos = regList opt_UseDoubleRegs
-longRegNos = regList opt_UseLongRegs
+vanillaRegNos = regList useVanillaRegs
+floatRegNos = regList useFloatRegs
+doubleRegNos = regList useDoubleRegs
+longRegNos = regList useLongRegs
allVanillaRegNos, allFloatRegNos, allDoubleRegNos, allLongRegNos :: [Int]
allVanillaRegNos = regList mAX_Vanilla_REG
allVanillaRegNos, allFloatRegNos, allDoubleRegNos, allLongRegNos :: [Int]
allVanillaRegNos = regList mAX_Vanilla_REG
opt_AllStrict,
opt_DictsStrict,
opt_MaxContextReductionDepth,
opt_AllStrict,
opt_DictsStrict,
opt_MaxContextReductionDepth,
opt_IrrefutableTuples,
opt_NumbersStrict,
opt_Parallel,
opt_IrrefutableTuples,
opt_NumbersStrict,
opt_Parallel,
opt_OmitInterfacePragmas,
opt_NoPruneTyDecls,
opt_NoPruneDecls,
opt_OmitInterfacePragmas,
opt_NoPruneTyDecls,
opt_NoPruneDecls,
opt_Static,
opt_Unregisterised,
opt_Static,
opt_Unregisterised,
- opt_Verbose,
-
- -- Code generation
- opt_UseVanillaRegs,
- opt_UseFloatRegs,
- opt_UseDoubleRegs,
- opt_UseLongRegs
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
| Opt_AllowOverlappingInstances
| Opt_AllowUndecidableInstances
| Opt_GlasgowExts
| Opt_AllowOverlappingInstances
| Opt_AllowUndecidableInstances
| Opt_GlasgowExts
+ | Opt_Generics
+
+ -- misc
+ | Opt_ReportCompile
deriving (Eq)
data DynFlags = DynFlags {
deriving (Eq)
data DynFlags = DynFlags {
-- language opts
opt_AllStrict = lookUp SLIT("-fall-strict")
opt_DictsStrict = lookUp SLIT("-fdicts-strict")
-- language opts
opt_AllStrict = lookUp SLIT("-fall-strict")
opt_DictsStrict = lookUp SLIT("-fdicts-strict")
-opt_Generics = lookUp SLIT("-fgenerics")
opt_IrrefutableTuples = lookUp SLIT("-firrefutable-tuples")
opt_MaxContextReductionDepth = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
opt_NumbersStrict = lookUp SLIT("-fnumbers-strict")
opt_IrrefutableTuples = lookUp SLIT("-firrefutable-tuples")
opt_MaxContextReductionDepth = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH
opt_NumbersStrict = lookUp SLIT("-fnumbers-strict")
opt_UF_CheapOp = ( 1 :: Int) -- Only one instruction; and the args are charged for
opt_UF_DearOp = ( 4 :: Int)
opt_UF_CheapOp = ( 1 :: Int) -- Only one instruction; and the args are charged for
opt_UF_DearOp = ( 4 :: Int)
-opt_ReportCompile = lookUp SLIT("-freport-compile")
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_Verbose = lookUp SLIT("-v")
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_Verbose = lookUp SLIT("-v")
-
-opt_UseVanillaRegs | opt_Unregisterised = 0
- | otherwise = mAX_Real_Vanilla_REG
-opt_UseFloatRegs | opt_Unregisterised = 0
- | otherwise = mAX_Real_Float_REG
-opt_UseDoubleRegs | opt_Unregisterised = 0
- | otherwise = mAX_Real_Double_REG
-opt_UseLongRegs | opt_Unregisterised = 0
- | otherwise = mAX_Real_Long_REG
\end{code}
%************************************************************************
\end{code}
%************************************************************************
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.5 2000/10/17 13:22:10 simonmar Exp $
+-- $Id: DriverFlags.hs,v 1.6 2000/10/18 09:40:18 simonmar Exp $
, ( "fallow-undecidable-instances",
NoArg (setDynFlag Opt_AllowUndecidableInstances) )
, ( "fallow-undecidable-instances",
NoArg (setDynFlag Opt_AllowUndecidableInstances) )
+
+ , ( "fgenerics", NoArg (setDynFlag Opt_Generics) )
+
+ , ( "freport-compile", NoArg (setDynFlag Opt_ReportCompile) )
]
-----------------------------------------------------------------------------
]
-----------------------------------------------------------------------------