diff options
author | buggymcbugfix <4444-buggymcbugfix@users.noreply.gitlab.haskell.org> | 2020-06-22 21:29:44 +0100 |
---|---|---|
committer | Vilem Liepelt <17603372+buggymcbugfix@users.noreply.github.com> | 2021-08-04 21:48:39 +0200 |
commit | dfae0f8cef959a8594fb075f5d8ef3cf014197e8 (patch) | |
tree | 113190d11bb9ac777e6bbacbc0e680b58b23f963 | |
parent | 061e9d78c6736cc741e716b62dfe4e8ed0634958 (diff) | |
download | haskell-dfae0f8cef959a8594fb075f5d8ef3cf014197e8.tar.gz |
Comments / refactor
-rw-r--r-- | compiler/GHC/Cmm.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Stg/Pipeline.hs | 16 | ||||
-rw-r--r-- | includes/rts/storage/Closures.h | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs index 3a461fa03c..e8cf4aebb1 100644 --- a/compiler/GHC/Cmm.hs +++ b/compiler/GHC/Cmm.hs @@ -103,6 +103,7 @@ data GenCmmDecl d h g deriving (Functor) type CmmDecl = GenCmmDecl CmmStatics CmmTopInfo CmmGraph + type CmmDeclSRTs = GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph type RawCmmDecl @@ -288,4 +289,3 @@ instance OutputableP env instr => OutputableP env (GenBasicBlock instr) where pprBBlock :: Outputable stmt => GenBasicBlock stmt -> SDoc pprBBlock (BasicBlock ident stmts) = hang (ppr ident <> colon) 4 (vcat (map ppr stmts)) - diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs index b0e1848f19..65794bf0c2 100644 --- a/compiler/GHC/Stg/Pipeline.hs +++ b/compiler/GHC/Stg/Pipeline.hs @@ -83,9 +83,6 @@ stg2stg logger dflags ictxt for_bytecode this_mod binds do_stg_pass :: [StgTopBinding] -> StgToDo -> StgM [StgTopBinding] do_stg_pass binds to_do = case to_do of - StgDoNothing -> - return binds - StgStats -> logTraceMsg logger "STG stats" (text (showStgStats binds)) (return binds) @@ -152,10 +149,9 @@ getStgToDo for_bytecode dflags = , optional Opt_StgLiftLams StgLiftLams , runWhen for_bytecode StgBcPrep , optional Opt_StgStats StgStats - ] where - optional opt = runWhen (gopt opt dflags) - mandatory = id - -runWhen :: Bool -> StgToDo -> StgToDo -runWhen True todo = todo -runWhen _ _ = StgDoNothing + ] + where + optional opt x + | gopt opt dflags = Just x + | otherwise = Nothing + mandatory = Just diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index ebb836bca2..70558d073b 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -162,7 +162,7 @@ typedef struct { typedef struct { StgHeader header; - StgWord ptrs; + StgWord ptrs; // number of elems StgWord size; // ptrs plus card table StgClosure *payload[]; // see also: StgMutArrPtrs macros in ClosureMacros.h @@ -170,7 +170,7 @@ typedef struct { typedef struct { StgHeader header; - StgWord ptrs; + StgWord ptrs; // number of elems StgClosure *payload[]; } StgSmallMutArrPtrs; |