[commit: ghc] master: Make GHC (the library) flexible in the choice of integer library (fc2ff6d)
git at git.haskell.org
git at git.haskell.org
Wed Oct 3 15:17:58 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/fc2ff6dd7496a33bf68165b28f37f40b7d647418/ghc
>---------------------------------------------------------------
commit fc2ff6dd7496a33bf68165b28f37f40b7d647418
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Wed Oct 3 15:36:55 2018 +0200
Make GHC (the library) flexible in the choice of integer library
Summary:
We have more and more users of GHC as a library, for example the
Haskell-to-WebAssembly-compiler https://github.com/tweag/asterius.
These need to make different decisions about various aspects of
code generation than the host compiler, and ideally GHC-the-library
allows them to set the `DynFlags` as needed.
This patch adds a new `DynFlag` that configures which `integer`
library to use. This flag is initialized by `cIntegerLibraryType`
(as before), and is only used in `CorePrep` to decide whether to
use `S#` or not.
The other code paths that were varying based on `cIntegerLibraryType`
are no now longer varying: The trick is to use `integer-wired-in`
as the `-this-unit-id` when compiling either `integer-gmp` or
`integer-simple`.
Test Plan: Validate is happy.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: TerrorJack, adamse, simonpj, rwbarton, carter
GHC Trac Issues: #13477
Differential Revision: https://phabricator.haskell.org/D5079
>---------------------------------------------------------------
fc2ff6dd7496a33bf68165b28f37f40b7d647418
compiler/basicTypes/Module.hs | 60 +++++++++++++++------------
compiler/coreSyn/CorePrep.hs | 5 ++-
compiler/ghc.mk | 2 -
compiler/main/DynFlags.hs | 4 ++
compiler/main/Packages.hs | 48 +++++++++++----------
compiler/prelude/PrelNames.hs | 49 +++++++++++++++-------
libraries/integer-gmp/integer-gmp.cabal | 5 ++-
libraries/integer-simple/integer-simple.cabal | 5 ++-
8 files changed, 110 insertions(+), 68 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fc2ff6dd7496a33bf68165b28f37f40b7d647418
More information about the ghc-commits
mailing list