summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/AsmCodeGen.lhs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-12 16:32:34 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-12 16:32:34 +0100
commit2b7319a67de0771d31626091e43dd3b60827a0ea (patch)
treecb1542cb4e9e7e6826e06f2fb94fd590dca2f834 /compiler/nativeGen/AsmCodeGen.lhs
parent44b5f471a314d964948c38684ce74b7a87df4ed8 (diff)
downloadhaskell-2b7319a67de0771d31626091e43dd3b60827a0ea.tar.gz
Pass DynFlags down to wordWidth
Diffstat (limited to 'compiler/nativeGen/AsmCodeGen.lhs')
-rw-r--r--compiler/nativeGen/AsmCodeGen.lhs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs
index 1490360057..1493a40a6b 100644
--- a/compiler/nativeGen/AsmCodeGen.lhs
+++ b/compiler/nativeGen/AsmCodeGen.lhs
@@ -955,13 +955,13 @@ cmmExprConFold referenceKind expr = do
-- SDM: re-enabled for now, while cmmRewriteAssignments is turned off
let expr' = if False -- dopt Opt_TryNewCodeGen dflags
then expr
- else cmmExprCon (targetPlatform dflags) expr
+ else cmmExprCon dflags expr
cmmExprNative referenceKind expr'
-cmmExprCon :: Platform -> CmmExpr -> CmmExpr
-cmmExprCon platform (CmmLoad addr rep) = CmmLoad (cmmExprCon platform addr) rep
-cmmExprCon platform (CmmMachOp mop args)
- = cmmMachOpFold platform mop (map (cmmExprCon platform) args)
+cmmExprCon :: DynFlags -> CmmExpr -> CmmExpr
+cmmExprCon dflags (CmmLoad addr rep) = CmmLoad (cmmExprCon dflags addr) rep
+cmmExprCon dflags (CmmMachOp mop args)
+ = cmmMachOpFold dflags mop (map (cmmExprCon dflags) args)
cmmExprCon _ other = other
-- handles both PIC and non-PIC cases... a very strange mixture
@@ -993,9 +993,9 @@ cmmExprNative referenceKind expr = do
-> do
dynRef <- cmmMakeDynamicReference dflags addImportCmmOpt referenceKind lbl
-- need to optimize here, since it's late
- return $ cmmMachOpFold platform (MO_Add wordWidth) [
+ return $ cmmMachOpFold dflags (MO_Add (wordWidth dflags)) [
dynRef,
- (CmmLit $ CmmInt (fromIntegral off) wordWidth)
+ (CmmLit $ CmmInt (fromIntegral off) (wordWidth dflags))
]
-- On powerpc (non-PIC), it's easier to jump directly to a label than