summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmCon.hs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-20 11:53:05 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2013-08-20 17:19:30 +0100
commite5374a1b3ac11851576f8835e19d9fc92d7735c3 (patch)
tree82cf705084772dad8b427574bdeae8f9abb7a7cb /compiler/codeGen/StgCmmCon.hs
parent3f279f37042458dfcfd06eceb127eed4a528c3cc (diff)
downloadhaskell-e5374a1b3ac11851576f8835e19d9fc92d7735c3.tar.gz
Cleanup StgCmm pass
This cleanup includes: * removing dead code. This includes forkStatics function, which was in fact one big noop, and global bindings in CgInfoDownwards, * converting functions that used FCode monad only to access DynFlags into functions that take DynFlags as a parameter and don't work in a monad, * addBindC function is now smarter. It extracts Id from CgIdInfo passed to it in the same way addBindsC does. Previously this was done at every call site, which was redundant.
Diffstat (limited to 'compiler/codeGen/StgCmmCon.hs')
-rw-r--r--compiler/codeGen/StgCmmCon.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index 4f12948bcc..57d4759346 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -50,22 +50,21 @@ import Data.Char
-- Top-level constructors
---------------------------------------------------------------
-cgTopRhsCon :: Id -- Name of thing bound to this RHS
+cgTopRhsCon :: DynFlags
+ -> Id -- Name of thing bound to this RHS
-> DataCon -- Id
-> [StgArg] -- Args
- -> FCode (CgIdInfo, FCode ())
-cgTopRhsCon id con args
- = do dflags <- getDynFlags
- let id_info = litIdInfo dflags id (mkConLFInfo con) (CmmLabel closure_label)
- return ( id_info, gen_code )
+ -> (CgIdInfo, FCode ())
+cgTopRhsCon dflags id con args =
+ let id_info = litIdInfo dflags id (mkConLFInfo con) (CmmLabel closure_label)
+ in (id_info, gen_code)
where
name = idName id
caffy = idCafInfo id -- any stgArgHasCafRefs args
closure_label = mkClosureLabel name caffy
gen_code =
- do { dflags <- getDynFlags
- ; this_mod <- getModuleName
+ do { this_mod <- getModuleName
; when (platformOS (targetPlatform dflags) == OSMinGW32) $
-- Windows DLLs have a problem with static cross-DLL refs.
ASSERT( not (isDllConApp dflags this_mod con args) ) return ()