diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-10-09 00:27:28 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-10-09 12:32:04 +0100 |
commit | 0a768bcbe6f7238d0bcdddd85fe24c99189453a0 (patch) | |
tree | a1e75804cc73c1f88fb3deae9fa7aaf0aaa75753 /compiler/iface | |
parent | 9c6223dd780b5a41be98702a583a1b7229841305 (diff) | |
download | haskell-0a768bcbe6f7238d0bcdddd85fe24c99189453a0.tar.gz |
Make the opt_UF_* static flags dynamic
I also removed the default values from the "Discounts and thresholds"
note: most of them were no longer up-to-date.
Along the way I added FloatSuffix to the argument parser, analogous to
IntSuffix.
Diffstat (limited to 'compiler/iface')
-rw-r--r-- | compiler/iface/BuildTyCl.lhs | 10 | ||||
-rw-r--r-- | compiler/iface/TcIface.lhs | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index 5f5e8a1896..be757c62ad 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -37,6 +37,7 @@ import TyCon import Type import Coercion +import DynFlags import TcRnMonad import Util import Outputable @@ -205,6 +206,8 @@ buildClass :: Bool -- True <=> do not include unfoldings buildClass no_unf tycon_name tvs sc_theta fds at_items sig_stuff tc_isrec = fixM $ \ rec_clas -> -- Only name generation inside loop do { traceIf (text "buildClass") + ; dflags <- getDynFlags + ; datacon_name <- newImplicitBinder tycon_name mkClassDataConOcc -- The class name is the 'parent' for this datacon, not its tycon, -- because one should import the class to get the binding for @@ -217,7 +220,7 @@ buildClass no_unf tycon_name tvs sc_theta fds at_items sig_stuff tc_isrec -- Make selectors for the superclasses ; sc_sel_names <- mapM (newImplicitBinder tycon_name . mkSuperDictSelOcc) [1..length sc_theta] - ; let sc_sel_ids = [ mkDictSelId no_unf sc_name rec_clas + ; let sc_sel_ids = [ mkDictSelId dflags no_unf sc_name rec_clas | sc_name <- sc_sel_names] -- We number off the Dict superclass selectors, 1, 2, 3 etc so that we -- can construct names for the selectors. Thus @@ -282,13 +285,14 @@ buildClass no_unf tycon_name tvs sc_theta fds at_items sig_stuff tc_isrec where mk_op_item :: Class -> TcMethInfo -> TcRnIf n m ClassOpItem mk_op_item rec_clas (op_name, dm_spec, _) - = do { dm_info <- case dm_spec of + = do { dflags <- getDynFlags + ; dm_info <- case dm_spec of NoDM -> return NoDefMeth GenericDM -> do { dm_name <- newImplicitBinder op_name mkGenDefMethodOcc ; return (GenDefMeth dm_name) } VanillaDM -> do { dm_name <- newImplicitBinder op_name mkDefaultMethodOcc ; return (DefMeth dm_name) } - ; return (mkDictSelId no_unf op_name rec_clas, dm_info) } + ; return (mkDictSelId dflags no_unf op_name rec_clas, dm_info) } \end{code} Note [Class newtypes and equality predicates] diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index b9783a8d4f..1efb11e21b 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -1198,11 +1198,12 @@ tcIdInfo ignore_prags name ty info \begin{code} tcUnfolding :: Name -> Type -> IdInfo -> IfaceUnfolding -> IfL Unfolding tcUnfolding name _ info (IfCoreUnfold stable if_expr) - = do { mb_expr <- tcPragExpr name if_expr + = do { dflags <- getDynFlags + ; mb_expr <- tcPragExpr name if_expr ; let unf_src = if stable then InlineStable else InlineRhs ; return (case mb_expr of Nothing -> NoUnfolding - Just expr -> mkUnfolding unf_src + Just expr -> mkUnfolding dflags unf_src True {- Top level -} is_bottoming expr) } where |