diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-26 15:10:03 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:01 -0400 |
commit | 2517a51c0f949c1021de9f7c16f67345c6ab78a9 (patch) | |
tree | 82c806209b25125a428a6415ade64d6c95de9328 /compiler/GHC/CmmToLlvm/Data.hs | |
parent | 3445b9652671280920755ee3d2b49780eeb3a991 (diff) | |
download | haskell-2517a51c0f949c1021de9f7c16f67345c6ab78a9.tar.gz |
DynFlags refactoring VIII (#17957)
* Remove several uses of `sdocWithDynFlags`, especially in GHC.Llvm.*
* Add LlvmOpts datatype to store Llvm backend options
* Remove Outputable instances (for LlvmVar, LlvmLit, LlvmStatic and
Llvm.MetaExpr) which require LlvmOpts.
* Rename ppMetaExpr into ppMetaAnnotExpr (pprMetaExpr is now used in place of `ppr :: MetaExpr -> SDoc`)
Diffstat (limited to 'compiler/GHC/CmmToLlvm/Data.hs')
-rw-r--r-- | compiler/GHC/CmmToLlvm/Data.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs index b32f619640..ac155179d1 100644 --- a/compiler/GHC/CmmToLlvm/Data.hs +++ b/compiler/GHC/CmmToLlvm/Data.hs @@ -17,7 +17,6 @@ import GHC.CmmToLlvm.Base import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm -import GHC.Driver.Session import GHC.Platform import GHC.Data.FastString @@ -71,7 +70,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do label <- strCLabel_llvm lbl static <- mapM genData xs lmsec <- llvmSection sec - platform <- getLlvmPlatform + platform <- getPlatform let types = map getStatType static strucTy = LMStruct types @@ -113,9 +112,9 @@ llvmSectionType p t = case t of -- | Format a Cmm Section into a LLVM section name llvmSection :: Section -> LlvmM LMSection llvmSection (Section t suffix) = do - dflags <- getDynFlags - let splitSect = gopt Opt_SplitSections dflags - platform = targetPlatform dflags + opts <- getLlvmOpts + let splitSect = llvmOptsSplitSections opts + platform = llvmOptsPlatform opts if not splitSect then return Nothing else do |