diff options
author | Ian Lynagh <igloo@earth.li> | 2008-12-09 23:01:57 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-12-09 23:01:57 +0000 |
commit | aedb94f5f220b5e442b23ecc445fd38c8d9b6ba0 (patch) | |
tree | de4bfff938b4bbb833143d2a773a77b6760626e6 /compiler/deSugar | |
parent | ee2623c8841a3a26c37bd7695a7db7be5d7e3a7f (diff) | |
download | haskell-aedb94f5f220b5e442b23ecc445fd38c8d9b6ba0.tar.gz |
Make some profiling flags dynamic
In particular:
-fauto-sccs-on-all-toplevs -auto-all -no-auto-all
-fauto-sccs-on-exported-toplevs -auto -no-auto
-fauto-sccs-on-individual-cafs -caf-all -no-caf-all
Diffstat (limited to 'compiler/deSugar')
-rw-r--r-- | compiler/deSugar/Desugar.lhs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index 8387146f17..18f177ab2e 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 |