diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-07 18:48:31 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-25 00:45:08 -0400 |
commit | 9dfeca6c2019fdb46613a68ccd6e650e40c7baac (patch) | |
tree | 29a2cda3faddedc7024be259011f4406b6473f45 /compiler/GHC/StgToCmm.hs | |
parent | 6333d7391068d8029eed3e8eff019b9e2c104c7b (diff) | |
download | haskell-9dfeca6c2019fdb46613a68ccd6e650e40c7baac.tar.gz |
Remove platform constant wrappers
Platform constant wrappers took a DynFlags parameter, hence implicitly
used the target platform constants. We removed them to allow support
for several platforms at once (#14335) and to avoid having to pass
the full DynFlags to every function (#17957).
Metric Decrease:
T4801
Diffstat (limited to 'compiler/GHC/StgToCmm.hs')
-rw-r--r-- | compiler/GHC/StgToCmm.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs index 40a43b3e06..268a1a6a16 100644 --- a/compiler/GHC/StgToCmm.hs +++ b/compiler/GHC/StgToCmm.hs @@ -177,7 +177,7 @@ cgTopBinding dflags (StgTopStringLit id str) = do BS.writeFile bFile str return bFile emitDecl decl - addBindC (litIdInfo dflags id mkLFStringLit lit) + addBindC (litIdInfo (targetPlatform dflags) id mkLFStringLit lit) cgTopRhs :: DynFlags -> RecFlag -> Id -> CgStgRhs -> (CgIdInfo, FCode ()) @@ -190,7 +190,7 @@ cgTopRhs dflags _rec bndr (StgRhsCon _cc con args) cgTopRhs dflags rec bndr (StgRhsClosure fvs cc upd_flag args body) = ASSERT(isEmptyDVarSet fvs) -- There should be no free variables - cgTopRhsClosure dflags rec bndr cc upd_flag args body + cgTopRhsClosure (targetPlatform dflags) rec bndr cc upd_flag args body --------------------------------------------------------------- @@ -216,28 +216,28 @@ mkModuleInit cost_centre_info this_mod hpc_info cgEnumerationTyCon :: TyCon -> FCode () cgEnumerationTyCon tycon - = do dflags <- getDynFlags + = do platform <- getPlatform emitRODataLits (mkLocalClosureTableLabel (tyConName tycon) NoCafRefs) [ CmmLabelOff (mkLocalClosureLabel (dataConName con) NoCafRefs) - (tagForCon dflags con) + (tagForCon platform con) | con <- tyConDataCons tycon] -cgDataCon :: DataCon -> FCode () --- Generate the entry code, info tables, and (for niladic constructor) +-- | Generate the entry code, info tables, and (for niladic constructor) -- the static closure, for a constructor. +cgDataCon :: DataCon -> FCode () cgDataCon data_con - = do { dflags <- getDynFlags + = do { profile <- getProfile ; platform <- getPlatform ; let (tot_wds, -- #ptr_wds + #nonptr_wds ptr_wds) -- #ptr_wds - = mkVirtConstrSizes dflags arg_reps + = mkVirtConstrSizes profile arg_reps nonptr_wds = tot_wds - ptr_wds dyn_info_tbl = - mkDataConInfoTable dflags data_con False ptr_wds nonptr_wds + mkDataConInfoTable profile data_con False ptr_wds nonptr_wds -- We're generating info tables, so we don't know and care about -- what the actual arguments are. Using () here as the place holder. @@ -257,7 +257,7 @@ cgDataCon data_con do { tickyEnterDynCon ; ldvEnter (CmmReg nodeReg) ; tickyReturnOldCon (length arg_reps) - ; void $ emitReturn [cmmOffsetB platform (CmmReg nodeReg) (tagForCon dflags data_con)] + ; void $ emitReturn [cmmOffsetB platform (CmmReg nodeReg) (tagForCon platform data_con)] } -- The case continuation code expects a tagged pointer } |