summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmLayout.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-06 22:51:28 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-06 22:51:28 +0100
commite6ef5ab66f51a8b821a4ae8646faca19cf600d94 (patch)
tree0ac8f5178caa80f1fabc3da22e46db8cb19a553a /compiler/codeGen/StgCmmLayout.hs
parent8e7fb28fc89eb9b99c747698f41995c269cd1090 (diff)
downloadhaskell-e6ef5ab66f51a8b821a4ae8646faca19cf600d94.tar.gz
Make tablesNextToCode "dynamic"
This is a bit odd by itself, but it's a stepping stone on the way to putting "target unregisterised" into the settings file.
Diffstat (limited to 'compiler/codeGen/StgCmmLayout.hs')
-rw-r--r--compiler/codeGen/StgCmmLayout.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index 8a20411064..4e2b478f77 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -54,7 +54,6 @@ import Name
import TyCon ( PrimRep(..) )
import BasicTypes ( RepArity )
import DynFlags
-import StaticFlags
import Module
import Constants
@@ -595,11 +594,12 @@ closureInfoPtr :: CmmExpr -> CmmExpr
-- Takes a closure pointer and returns the info table pointer
closureInfoPtr e = CmmLoad e bWord
-entryCode :: CmmExpr -> CmmExpr
+entryCode :: DynFlags -> CmmExpr -> CmmExpr
-- Takes an info pointer (the first word of a closure)
-- and returns its entry code
-entryCode e | tablesNextToCode = e
- | otherwise = CmmLoad e bWord
+entryCode dflags e
+ | tablesNextToCode dflags = e
+ | otherwise = CmmLoad e bWord
getConstrTag :: DynFlags -> CmmExpr -> CmmExpr
-- Takes a closure pointer, and return the *zero-indexed*
@@ -624,8 +624,8 @@ infoTable :: DynFlags -> CmmExpr -> CmmExpr
-- and returns a pointer to the first word of the standard-form
-- info table, excluding the entry-code word (if present)
infoTable dflags info_ptr
- | tablesNextToCode = cmmOffsetB info_ptr (- stdInfoTableSizeB dflags)
- | otherwise = cmmOffsetW info_ptr 1 -- Past the entry code pointer
+ | tablesNextToCode dflags = cmmOffsetB info_ptr (- stdInfoTableSizeB dflags)
+ | otherwise = cmmOffsetW info_ptr 1 -- Past the entry code pointer
infoTableConstrTag :: DynFlags -> CmmExpr -> CmmExpr
-- Takes an info table pointer (from infoTable) and returns the constr tag
@@ -657,7 +657,7 @@ funInfoTable :: DynFlags -> CmmExpr -> CmmExpr
-- and returns a pointer to the first word of the StgFunInfoExtra struct
-- in the info table.
funInfoTable dflags info_ptr
- | tablesNextToCode
+ | tablesNextToCode dflags
= cmmOffsetB info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev)
| otherwise
= cmmOffsetW info_ptr (1 + stdInfoTableSizeW dflags)