summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-08-19 16:33:31 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2019-08-22 22:19:26 -0400
commitc3e26ab3bd450a2ad17cc80b41dda084558039a2 (patch)
tree488bb62435b4c4616c360821c0cfa17e5e909dc4
parent8f32d2bc51bb4b844458125c42168dee555e173a (diff)
downloadhaskell-c3e26ab3bd450a2ad17cc80b41dda084558039a2.tar.gz
Remove special case in SRT generation with -split-sections
Previously we were using an empty ModuleSRTInfo for each Cmm group with -split-section. As far as I can see this has no benefits, and simplifying this makes another patch simpler (!1304). We also remove some outdated comments: we no longer generate one module-level SRT.
-rw-r--r--compiler/main/HscMain.hs31
1 files changed, 5 insertions, 26 deletions
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 47e23edf57..d12ff03e86 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -149,7 +149,6 @@ import DynamicLoading ( initializePlugins )
import DynFlags
import ErrUtils
-import GHC.Platform ( platformOS, osSubsectionsViaSymbols )
import Outputable
import NameEnv
@@ -1523,31 +1522,11 @@ doCodeGen hsc_env this_mod data_tycons
ppr_stream1 = Stream.mapM dump1 cmm_stream
- -- We are building a single SRT for the entire module, so
- -- we must thread it through all the procedures as we cps-convert them.
- us <- mkSplitUniqSupply 'S'
-
- -- When splitting, we generate one SRT per split chunk, otherwise
- -- we generate one SRT for the whole module.
- let
- pipeline_stream
- | gopt Opt_SplitSections dflags ||
- osSubsectionsViaSymbols (platformOS (targetPlatform dflags))
- = {-# SCC "cmmPipeline" #-}
- let run_pipeline us cmmgroup = do
- (_topSRT, cmmgroup) <-
- cmmPipeline hsc_env (emptySRT this_mod) cmmgroup
- return (us, cmmgroup)
-
- in do _ <- Stream.mapAccumL run_pipeline us ppr_stream1
- return ()
-
- | otherwise
- = {-# SCC "cmmPipeline" #-}
- let run_pipeline = cmmPipeline hsc_env
- in void $ Stream.mapAccumL run_pipeline (emptySRT this_mod) ppr_stream1
-
- let
+ pipeline_stream
+ = {-# SCC "cmmPipeline" #-}
+ let run_pipeline = cmmPipeline hsc_env
+ in void $ Stream.mapAccumL run_pipeline (emptySRT this_mod) ppr_stream1
+
dump2 a = do dumpIfSet_dyn dflags Opt_D_dump_cmm
"Output Cmm" (ppr a)
return a