summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToLlvm/Data.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/CmmToLlvm/Data.hs')
-rw-r--r--compiler/GHC/CmmToLlvm/Data.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
index 7a6320f947..deb1929968 100644
--- a/compiler/GHC/CmmToLlvm/Data.hs
+++ b/compiler/GHC/CmmToLlvm/Data.hs
@@ -169,23 +169,23 @@ genStaticLit (CmmVec ls)
-- Leave unresolved, will fix later
genStaticLit cmm@(CmmLabel l) = do
var <- getGlobalPtr =<< strCLabel_llvm l
- dflags <- getDynFlags
+ platform <- getPlatform
let ptr = LMStaticPointer var
- lmty = cmmToLlvmType $ cmmLitType dflags cmm
+ lmty = cmmToLlvmType $ cmmLitType platform cmm
return $ LMPtoI ptr lmty
genStaticLit (CmmLabelOff label off) = do
- dflags <- getDynFlags
+ platform <- getPlatform
var <- genStaticLit (CmmLabel label)
- let offset = LMStaticLit $ LMIntLit (toInteger off) (llvmWord dflags)
+ let offset = LMStaticLit $ LMIntLit (toInteger off) (llvmWord platform)
return $ LMAdd var offset
genStaticLit (CmmLabelDiffOff l1 l2 off w) = do
- dflags <- getDynFlags
+ platform <- getPlatform
var1 <- genStaticLit (CmmLabel l1)
var2 <- genStaticLit (CmmLabel l2)
let var
- | w == wordWidth dflags = LMSub var1 var2
+ | w == wordWidth platform = LMSub var1 var2
| otherwise = LMTrunc (LMSub var1 var2) (widthToLlvmInt w)
offset = LMStaticLit $ LMIntLit (toInteger off) (LMInt $ widthInBits w)
return $ LMAdd var offset