summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmLayout.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/StgCmmLayout.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/StgCmmLayout.hs')
-rw-r--r--compiler/codeGen/StgCmmLayout.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index c6e57d5041..6c6e49dafa 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -39,8 +39,7 @@ import CmmInfo
import CLabel
import StgSyn
import Id
-import Name
-import TyCon ( PrimRep(..) )
+import TyCon ( PrimRep(..) )
import BasicTypes ( RepArity )
import DynFlags
import Module
@@ -360,15 +359,14 @@ mkVirtConstrOffsets dflags = mkVirtHeapOffsets dflags False
-- bring in ARG_P, ARG_N, etc.
#include "../includes/rts/storage/FunTypes.h"
-mkArgDescr :: Name -> [Id] -> FCode ArgDescr
-mkArgDescr _nm args
- = do dflags <- getDynFlags
- let arg_bits = argBits dflags arg_reps
- arg_reps = filter isNonV (map idArgRep args)
+mkArgDescr :: DynFlags -> [Id] -> ArgDescr
+mkArgDescr dflags args
+ = let arg_bits = argBits dflags arg_reps
+ arg_reps = filter isNonV (map idArgRep args)
-- Getting rid of voids eases matching of standard patterns
- case stdPattern arg_reps of
- Just spec_id -> return (ArgSpec spec_id)
- Nothing -> return (ArgGen arg_bits)
+ in case stdPattern arg_reps of
+ Just spec_id -> ArgSpec spec_id
+ Nothing -> ArgGen arg_bits
argBits :: DynFlags -> [ArgRep] -> [Bool] -- True for non-ptr, False for ptr
argBits _ [] = []