diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-09-06 11:31:01 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-06 11:33:07 -0400 |
commit | 22733532171330136d87533d523f565f2a4f102f (patch) | |
tree | d399f168096fe203d459fb5fa0fc1210ff05bd4c /ghc | |
parent | 0cd467b2269595e1ae2bc273c3acf9e14adeb9e7 (diff) | |
download | haskell-22733532171330136d87533d523f565f2a4f102f.tar.gz |
Clean up opt and llc
The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean
up introduces a shared data structure to carry the arguments we pass to
each tool so that corresponding flags are next to each other. It drops
the hard coded data layouts in favor of using `-mtriple` and have LLVM
infer them. Furthermore we add `clang` as a proper tool, so we don't
rely on assuming that `clang` is called `clang` on the `PATH` when using
`clang` as the assembler. Finally this diff also changes the type of
`optLevel` from `Int` to `Word`, as we do not have negative optimization
levels.
Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon
Reviewed By: kavon
Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj,
kavon, simonmar, thomie, erikd, snowleopard
Differential Revision: https://phabricator.haskell.org/D3352
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 4 | ||||
-rw-r--r-- | ghc/ghc.mk | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 8012d741e0..6a03b3c365 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -2510,7 +2510,7 @@ showDynFlags show_all dflags = do is_on = test f dflags quiet = not show_all && test f default_dflags == is_on - default_dflags = defaultDynFlags (settings dflags) + default_dflags = defaultDynFlags (settings dflags) (llvmTargets dflags) (ghciFlags,others) = partition (\f -> flagSpecFlag f `elem` flgs) DynFlags.fFlags @@ -2921,7 +2921,7 @@ showLanguages' show_all dflags = quiet = not show_all && test f default_dflags == is_on default_dflags = - defaultDynFlags (settings dflags) `lang_set` + defaultDynFlags (settings dflags) (llvmTargets dflags) `lang_set` case language dflags of Nothing -> Just Haskell2010 other -> other diff --git a/ghc/ghc.mk b/ghc/ghc.mk index 319f969c75..20fa142df5 100644 --- a/ghc/ghc.mk +++ b/ghc/ghc.mk @@ -132,6 +132,9 @@ all_ghc_stage3 : $(GHC_STAGE3) $(INPLACE_LIB)/settings : settings "$(CP)" $< $@ +$(INPLACE_LIB)/llvm-targets : llvm-targets + "$(CP)" $< $@ + $(INPLACE_LIB)/platformConstants: $(includes_GHCCONSTANTS_HASKELL_VALUE) "$(CP)" $< $@ @@ -140,6 +143,7 @@ $(INPLACE_LIB)/platformConstants: $(includes_GHCCONSTANTS_HASKELL_VALUE) GHC_DEPENDENCIES += $$(unlit_INPLACE) GHC_DEPENDENCIES += $(INPLACE_LIB)/settings +GHC_DEPENDENCIES += $(INPLACE_LIB)/llvm-targets GHC_DEPENDENCIES += $(INPLACE_LIB)/platformConstants $(GHC_STAGE1) : | $(GHC_DEPENDENCIES) @@ -167,6 +171,7 @@ $(GHC_STAGE2) : $(foreach w,$(GhcLibWays),libraries/base/dist-install/build/GHC/ endif INSTALL_LIBS += settings +INSTALL_LIBS += llvm-targets ifeq "$(Windows_Host)" "NO" install: install_ghc_link |