[project @ 2001-03-13 12:50:29 by simonmar]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsBinds.lhs
index 98af452..cc9c363 100644 (file)
@@ -24,14 +24,12 @@ import DsGRHSs              ( dsGuarded )
 import DsUtils
 import Match           ( matchWrapper )
 
-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 VarSet
-import Type            ( mkTyVarTy, isDictTy )
+import Type            ( mkTyVarTy )
 import Subst           ( mkTyVarSubst, substTy )
 import TysWiredIn      ( voidTy )
 import Outputable
@@ -80,8 +78,8 @@ dsMonoBinds _ (VarMonoBind var expr) rest
 
 dsMonoBinds auto_scc (FunMonoBind fun _ matches locn) rest
   = putSrcLocDs locn   $
-    matchWrapper (FunMatch fun) matches error_string   `thenDs` \ (args, body) ->
-    addAutoScc auto_scc (fun, mkLams args body)                `thenDs` \ pair ->
+    matchWrapper (FunRhs (idName fun)) matches error_string    `thenDs` \ (args, body) ->
+    addAutoScc auto_scc (fun, mkLams args body)                        `thenDs` \ pair ->
     returnDs (pair : rest)
   where
     error_string = "function " ++ showSDoc (ppr fun)
@@ -190,7 +188,7 @@ addSccs NoSccs   exports = NoSccs
 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)
@@ -200,7 +198,7 @@ addAutoScc :: AutoScc               -- if needs be, decorate toplevs?
           -> 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
@@ -209,9 +207,6 @@ addAutoScc (TopLevelAddSccs auto_scc_fn) pair@(bndr, core_expr)
 
 addAutoScc _ pair
      = returnDs pair
-
-noUserSCC (Note (SCC _) _) = False
-worthSCC core_expr         = True
 \end{code}
 
 If profiling and dealing with a dict binding,