Commit c3e26ab3 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan

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.
parent 8f32d2bc
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment