[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Bignum: add backward compat integer-gmp functions

Marge Bot gitlab at gitlab.haskell.org
Wed Aug 5 08:32:41 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
d613ed76 by Sylvain Henry at 2020-08-05T03:59:27-04:00
Bignum: add backward compat integer-gmp functions

Also enhance bigNatCheck# and isValidNatural test

- - - - -
3f2f7718 by Sylvain Henry at 2020-08-05T03:59:27-04:00
Bignum: add more BigNat compat functions in integer-gmp

- - - - -
5e12cd17 by Krzysztof Gogolewski at 2020-08-05T04:00:04-04:00
Rename Core.Opt.Driver -> Core.Opt.Pipeline

Closes #18504.

- - - - -
2bff2f87 by Ben Gamari at 2020-08-05T04:00:39-04:00
Revert "iserv: Don't pass --export-dynamic on FreeBSD"

This reverts commit 2290eb02cf95e9cfffcb15fc9c593d5ef79c75d9.

- - - - -
53ce0db5 by Ben Gamari at 2020-08-05T04:00:39-04:00
Refactor handling of object merging

Previously to merge a set of object files we would invoke the linker as
usual, adding -r to the command-line. However, this can result in
non-sensical command-lines which causes lld to balk (#17962).

To avoid this we introduce a new tool setting into GHC, -pgmlm, which is
the linker which we use to merge object files.

- - - - -
eb7013c3 by Hécate at 2020-08-05T04:01:15-04:00
Remove all the unnecessary LANGUAGE pragmas

- - - - -
fbcb886d by Ryan Scott at 2020-08-05T04:01:51-04:00
Make CodeQ and TExpQ levity polymorphic

The patch is quite straightforward. The only tricky part is that
`Language.Haskell.TH.Lib.Internal` now must be `Trustworthy` instead
of `Safe` due to the `GHC.Exts` import (in order to import `TYPE`).

Since `CodeQ` has yet to appear in any released version of
`template-haskell`, I didn't bother mentioning the change to `CodeQ`
in the `template-haskell` release notes.

Fixes #18521.

- - - - -
663c342b by Vladislav Zavialov at 2020-08-05T04:32:36-04:00
Grammar for types and data/newtype constructors

Before this patch, we parsed types into a reversed sequence
of operators and operands. For example, (F x y + G a b * X)
would be parsed as [X, *, b, a, G, +, y, x, F],
using a simple grammar:

	tyapps
	  : tyapp
	  | tyapps tyapp

	tyapp
	  : atype
	  | PREFIX_AT atype
	  | tyop
	  | unpackedness

Then we used a hand-written state machine to assemble this
 either into a type,        using 'mergeOps',
     or into a constructor, using 'mergeDataCon'.

This is due to a syntactic ambiguity:

	data T1 a =          MkT1 a
	data T2 a = Ord a => MkT2 a

In T1, what follows after the = sign is a data/newtype constructor
declaration. However, in T2, what follows is a type (of kind
Constraint). We don't know which of the two we are parsing until we
encounter =>, and we cannot check for => without unlimited lookahead.

This poses a few issues when it comes to e.g. infix operators:

	data I1 = Int :+ Bool :+ Char          -- bad
	data I2 = Int :+ Bool :+ Char => MkI2  -- fine

By this issue alone we are forced into parsing into an intermediate
representation and doing a separate validation pass.

However, should that intermediate representation be as low-level as a
flat sequence of operators and operands?

Before GHC Proposal #229, the answer was Yes, due to some particularly
nasty corner cases:

	data T = ! A :+ ! B          -- used to be fine, hard to parse
	data T = ! A :+ ! B => MkT   -- bad

However, now the answer is No, as this corner case is gone:

	data T = ! A :+ ! B          -- bad
	data T = ! A :+ ! B => MkT   -- bad

This means we can write a proper grammar for types, overloading it in
the DisambECP style, see Note [Ambiguous syntactic categories].

With this patch, we introduce a new class, DisambTD. Just like
DisambECP is used to disambiguate between expressions, commands, and patterns,
DisambTD  is used to disambiguate between types and data/newtype constructors.

This way, we get a proper, declarative grammar for constructors and
types:

	infixtype
	  : ftype
	  | ftype tyop infixtype
	  | unpackedness infixtype

	ftype
	  : atype
	  | tyop
	  | ftype tyarg
	  | ftype PREFIX_AT tyarg

	tyarg
	  : atype
	  | unpackedness atype

And having a grammar for types means we are a step closer to using a
single grammar for types and expressions.

- - - - -
b5d3042b by Vladislav Zavialov at 2020-08-05T04:32:36-04:00
Clean up the story around runPV/runECP_P/runECP_PV

This patch started as a small documentation change, an attempt to make
Note [Parser-Validator] and Note [Ambiguous syntactic categories]
more clear and up-to-date.

But it turned out that runECP_P/runECP_PV are weakly motivated,
and it's easier to remove them than to find a good rationale/explanation
for their existence.

As the result, there's a bit of refactoring in addition to
a documentation update.

- - - - -
5c4f047f by Vladislav Zavialov at 2020-08-05T04:32:37-04:00
Fix debug_ppr_ty ForAllTy (#18522)

Before this change, GHC would
pretty-print   forall k. forall a -> ()
          as   forall @k a. ()
which isn't even valid Haskell.

- - - - -
4eacd06b by Vladislav Zavialov at 2020-08-05T04:32:37-04:00
Fix visible forall in ppr_ty (#18522)

Before this patch, this type:
  T :: forall k -> (k ~ k) => forall j -> k -> j -> Type
was printed incorrectly as:
  T :: forall k j -> (k ~ k) => k -> j -> Type

- - - - -
a63823a8 by Richard Eisenberg at 2020-08-05T04:32:37-04:00
Fail eagerly on a lev-poly datacon arg

Close #18534.

See commentary in the patch.

- - - - -


30 changed files:

- aclocal.m4
- compiler/GHC/Core/Opt/Driver.hs → compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/phases.rst
- hadrian/cfg/system.config.in
- hadrian/hadrian.cabal
- hadrian/src/Builder.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Library.hs
- hadrian/src/Settings/Builders/Ld.hs
- + hadrian/src/Settings/Builders/MergeObjects.hs
- hadrian/src/Settings/Default.hs
- includes/ghc.mk
- libraries/base/.hlint.yaml
- libraries/base/Control/Concurrent/QSemN.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a4a5637ec6143494f40013c183c723c0dea3cd9...a63823a8d3aa335efa643f2a2826dde539083167

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a4a5637ec6143494f40013c183c723c0dea3cd9...a63823a8d3aa335efa643f2a2826dde539083167
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200805/0ad32365/attachment.html>


More information about the ghc-commits mailing list