summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-03-27 00:27:01 -0400
committerBen Gamari <ben@smart-cactus.org>2019-05-14 16:41:19 -0400
commite529c65eacf595006dd5358491d28c202d673732 (patch)
tree0498cb0a7023c491c240d64069e2442073e83d77 /compiler/llvmGen
parentf9e4ea401121572d799b9db56f24aa1abdf5edf8 (diff)
downloadhaskell-e529c65eacf595006dd5358491d28c202d673732.tar.gz
Remove all target-specific portions of Config.hs
1. If GHC is to be multi-target, these cannot be baked in at compile time. 2. Compile-time flags have a higher maintenance than run-time flags. 3. The old way makes build system implementation (various bootstrapping details) with the thing being built. E.g. GHC doesn't need to care about which integer library *will* be used---this is purely a crutch so the build system doesn't need to pass flags later when using that library. 4. Experience with cross compilation in Nixpkgs has shown things work nicer when compiler's can *optionally* delegate the bootstrapping the package manager. The package manager knows the entire end-goal build plan, and thus can make top-down decisions on bootstrapping. GHC can just worry about GHC, not even core library like base and ghc-prim!
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Base.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index 15101c82ee..d55c339888 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -390,17 +390,15 @@ ghcInternalFunctions = do
-- | Pretty print a 'CLabel'.
strCLabel_llvm :: CLabel -> LlvmM LMString
strCLabel_llvm lbl = do
- platform <- getLlvmPlatform
dflags <- getDynFlags
- let sdoc = pprCLabel platform lbl
+ let sdoc = pprCLabel dflags lbl
str = Outp.renderWithStyle dflags sdoc (Outp.mkCodeStyle Outp.CStyle)
return (fsLit str)
strDisplayName_llvm :: CLabel -> LlvmM LMString
strDisplayName_llvm lbl = do
- platform <- getLlvmPlatform
dflags <- getDynFlags
- let sdoc = pprCLabel platform lbl
+ let sdoc = pprCLabel dflags lbl
depth = Outp.PartWay 1
style = Outp.mkUserStyle dflags Outp.reallyAlwaysQualify depth
str = Outp.renderWithStyle dflags sdoc style
@@ -416,9 +414,8 @@ dropInfoSuffix = go
strProcedureName_llvm :: CLabel -> LlvmM LMString
strProcedureName_llvm lbl = do
- platform <- getLlvmPlatform
dflags <- getDynFlags
- let sdoc = pprCLabel platform lbl
+ let sdoc = pprCLabel dflags lbl
depth = Outp.PartWay 1
style = Outp.mkUserStyle dflags Outp.neverQualify depth
str = Outp.renderWithStyle dflags sdoc style