import DsUtils
import Match ( matchWrapper )
-import BasicTypes ( RecFlag(..) )
-import CmdLineOpts ( opt_SccProfilingOn, opt_AutoSccsOnAllToplevs,
- opt_AutoSccsOnExportedToplevs, opt_AutoSccsOnDicts
- )
-import CostCentre ( CostCentre, mkAutoCC, IsCafCC(..) )
-import Id ( idType, idName, isUserExportedId, isSpecPragmaId, Id )
+import CmdLineOpts ( opt_AutoSccsOnAllToplevs, opt_AutoSccsOnExportedToplevs )
+import CostCentre ( mkAutoCC, IsCafCC(..) )
+import Id ( idType, idName, isExportedId, isSpecPragmaId, Id )
import NameSet
-import VarEnv
import VarSet
-import Type ( mkTyVarTy, isDictTy )
+import Type ( mkTyVarTy )
import Subst ( mkTyVarSubst, substTy )
import TysWiredIn ( voidTy )
import Outputable
-
-import Maybe
-import IOExts (trace)
+import Maybe ( isJust )
\end{code}
%************************************************************************
dsMonoBinds auto_scc (FunMonoBind fun _ matches locn) rest
= putSrcLocDs locn $
- matchWrapper (FunMatch fun) matches error_string `thenDs` \ (args, body) ->
+ matchWrapper (FunRhs fun) matches `thenDs` \ (args, body) ->
addAutoScc auto_scc (fun, mkLams args body) `thenDs` \ pair ->
returnDs (pair : rest)
- where
- error_string = "function " ++ showSDoc (ppr fun)
dsMonoBinds auto_scc (PatMonoBind pat grhss locn) rest
= putSrcLocDs locn $
addSccs TopLevel exports
= TopLevelAddSccs (\id -> case [ exp | (_,exp,loc) <- exports, loc == id ] of
(exp:_) | opt_AutoSccsOnAllToplevs ||
- (isUserExportedId exp &&
+ (isExportedId exp &&
opt_AutoSccsOnExportedToplevs)
-> Just exp
_ -> Nothing)
-> DsM (Id, CoreExpr)
addAutoScc (TopLevelAddSccs auto_scc_fn) pair@(bndr, core_expr)
- | do_auto_scc && worthSCC core_expr
+ | do_auto_scc
= getModuleDs `thenDs` \ mod ->
returnDs (bndr, mkSCC (mkAutoCC top_bndr mod NotCafCC) core_expr)
where do_auto_scc = isJust maybe_auto_scc
addAutoScc _ pair
= returnDs pair
-
-noUserSCC (Note (SCC _) _) = False
-worthSCC core_expr = True
\end{code}
If profiling and dealing with a dict binding,