summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgCon.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-07-16 20:53:21 +0100
committerIan Lynagh <igloo@earth.li>2012-07-16 22:40:37 +0100
commitcdf946e45024f76ce4f22462f511a0490fef1dff (patch)
tree993709cdc4a579e34b056cfb31826cd2b358f340 /compiler/codeGen/CgCon.lhs
parent5d0fce85fd5c885343196142b15b8a8d2928d3fe (diff)
downloadhaskell-cdf946e45024f76ce4f22462f511a0490fef1dff.tar.gz
Make -fPIC a dynamic flag
Hopefully I've kept the logic the same, and we now generate warnings if the user does -fno-PIC but we ignore them (e.g. because they're on OS X amd64).
Diffstat (limited to 'compiler/codeGen/CgCon.lhs')
-rw-r--r--compiler/codeGen/CgCon.lhs17
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/codeGen/CgCon.lhs b/compiler/codeGen/CgCon.lhs
index aff5e468ca..78c1934869 100644
--- a/compiler/codeGen/CgCon.lhs
+++ b/compiler/codeGen/CgCon.lhs
@@ -119,9 +119,10 @@ buildDynCon :: Id -- Name of the thing to which this constr will
-> FCode CgIdInfo -- Return details about how to find it
buildDynCon binder ccs con args
= do dflags <- getDynFlags
- buildDynCon' (targetPlatform dflags) binder ccs con args
+ buildDynCon' dflags (targetPlatform dflags) binder ccs con args
-buildDynCon' :: Platform
+buildDynCon' :: DynFlags
+ -> Platform
-> Id
-> CostCentreStack
-> DataCon
@@ -148,7 +149,7 @@ which have exclusively size-zero (VoidRep) args, we generate no code
at all.
\begin{code}
-buildDynCon' _ binder _ con []
+buildDynCon' _ _ binder _ con []
= returnFC (taggedStableIdInfo binder
(mkLblExpr (mkClosureLabel (dataConName con)
(idCafInfo binder)))
@@ -183,9 +184,9 @@ because they don't support cross package data references well.
\begin{code}
-buildDynCon' platform binder _ con [arg_amode]
+buildDynCon' dflags platform binder _ con [arg_amode]
| maybeIntLikeCon con
- , platformOS platform /= OSMinGW32 || not opt_PIC
+ , platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, (_, CmmLit (CmmInt val _)) <- arg_amode
, let val_int = (fromIntegral val) :: Int
, val_int <= mAX_INTLIKE && val_int >= mIN_INTLIKE
@@ -195,9 +196,9 @@ buildDynCon' platform binder _ con [arg_amode]
intlike_amode = CmmLit (cmmLabelOffW intlike_lbl offsetW)
; returnFC (taggedStableIdInfo binder intlike_amode (mkConLFInfo con) con) }
-buildDynCon' platform binder _ con [arg_amode]
+buildDynCon' dflags platform binder _ con [arg_amode]
| maybeCharLikeCon con
- , platformOS platform /= OSMinGW32 || not opt_PIC
+ , platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, (_, CmmLit (CmmInt val _)) <- arg_amode
, let val_int = (fromIntegral val) :: Int
, val_int <= mAX_CHARLIKE && val_int >= mIN_CHARLIKE
@@ -212,7 +213,7 @@ buildDynCon' platform binder _ con [arg_amode]
Now the general case.
\begin{code}
-buildDynCon' _ binder ccs con args
+buildDynCon' _ _ binder ccs con args
= do {
; let
(closure_info, amodes_w_offsets) = layOutDynConstr con args