X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDesugar.lhs;h=18f177ab2e547aae81fdb1c78fb88375c8e10a78;hb=a1895147d4d0480f65535c99488ba25873e97bff;hp=8387146f17a89bcead7809cef9456f5547d3de27;hpb=9bcd95bad83ee937c178970e8b729732e680fe1e;p=ghc-hetmet.git diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index 8387146..18f177a 100644 --- a/compiler/deSugar/Desugar.lhs +++ b/compiler/deSugar/Desugar.lhs @@ -77,7 +77,7 @@ deSugar hsc_env -- Desugar the program ; let export_set = availsToNameSet exports - ; let auto_scc = mkAutoScc mod export_set + ; let auto_scc = mkAutoScc dflags mod export_set ; let target = hscTarget dflags ; let hpcInfo = emptyHpcInfo other_hpc_info ; (msgs, mb_res) @@ -150,16 +150,18 @@ deSugar hsc_env ; return (msgs, Just mod_guts) }}} -mkAutoScc :: Module -> NameSet -> AutoScc -mkAutoScc mod exports +mkAutoScc :: DynFlags -> Module -> NameSet -> AutoScc +mkAutoScc dflags mod exports | not opt_SccProfilingOn -- No profiling = NoSccs - | opt_AutoSccsOnAllToplevs -- Add auto-scc on all top-level things + -- Add auto-scc on all top-level things + | dopt Opt_AutoSccsOnAllToplevs dflags = AddSccs mod (\id -> not $ isDerivedOccName $ getOccName id) -- See #1641. This is pretty yucky, but I can't see a better way -- to identify compiler-generated Ids, and at least this should -- catch them all. - | opt_AutoSccsOnExportedToplevs -- Only on exported things + -- Only on exported things + | dopt Opt_AutoSccsOnExportedToplevs dflags = AddSccs mod (\id -> idName id `elemNameSet` exports) | otherwise = NoSccs