summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-12 12:37:01 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-12 12:37:01 +0100
commit44b5f471a314d964948c38684ce74b7a87df4ed8 (patch)
tree075f88991983d976ad13714da61b9773a6ca0a02 /compiler/llvmGen
parentf611396a581e733c41cee41750c95675bdb64961 (diff)
downloadhaskell-44b5f471a314d964948c38684ce74b7a87df4ed8.tar.gz
Pass DynFlags down to gcWord
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Base.hs4
-rw-r--r--compiler/llvmGen/LlvmCodeGen/CodeGen.hs7
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index d9a43fb249..00c2129ed9 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -137,8 +137,8 @@ tysToParams :: [LlvmType] -> [LlvmParameter]
tysToParams = map (\ty -> (ty, []))
-- | Pointer width
-llvmPtrBits :: Int
-llvmPtrBits = widthInBits $ typeWidth gcWord
+llvmPtrBits :: DynFlags -> Int
+llvmPtrBits dflags = widthInBits $ typeWidth $ gcWord dflags
-- ----------------------------------------------------------------------------
-- * Llvm Version
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index a4b7652f8a..f80a4f2b4c 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -652,9 +652,10 @@ genStore_slow env addr val meta = do
other ->
pprPanic "genStore: ptr not right type!"
(PprCmm.pprExpr addr <+> text (
- "Size of Ptr: " ++ show llvmPtrBits ++
+ "Size of Ptr: " ++ show (llvmPtrBits dflags) ++
", Size of var: " ++ show (llvmWidthInBits other) ++
", Var: " ++ show vaddr))
+ where dflags = getDflags env
-- | Unconditional branch
@@ -1130,10 +1131,10 @@ genLoad_slow env e ty meta = do
other -> pprPanic "exprToVar: CmmLoad expression is not right type!"
(PprCmm.pprExpr e <+> text (
- "Size of Ptr: " ++ show llvmPtrBits ++
+ "Size of Ptr: " ++ show (llvmPtrBits dflags) ++
", Size of var: " ++ show (llvmWidthInBits other) ++
", Var: " ++ show iptr))
-
+ where dflags = getDflags env
-- | Handle CmmReg expression
--