+
+mkAutoScc :: Module -> NameSet -> AutoScc
+mkAutoScc mod exports
+ | not opt_SccProfilingOn -- No profiling
+ = NoSccs
+ | opt_AutoSccsOnAllToplevs -- Add auto-scc on all top-level things
+ = AddSccs mod (\id -> True)
+ | opt_AutoSccsOnExportedToplevs -- Only on exported things
+ = AddSccs mod (\id -> idName id `elemNameSet` exports)
+ | otherwise
+ = NoSccs
+