[Git][ghc/ghc][wip/andreask/exprSizeBangs] 146 commits: SysTools.Process: Handle exceptions in readCreateProcessWithExitCode'
Ben Gamari
gitlab at gitlab.haskell.org
Mon Sep 21 13:24:10 UTC 2020
Ben Gamari pushed to branch wip/andreask/exprSizeBangs at Glasgow Haskell Compiler / GHC
Commits:
0a1ecc5f by Ben Gamari at 2020-08-25T07:37:05-04:00
SysTools.Process: Handle exceptions in readCreateProcessWithExitCode'
In #18069 we are observing MVar deadlocks from somewhere in ghc.exe.
This use of MVar stood out as being one of the more likely culprits.
Here we make sure that it is exception-safe.
- - - - -
db8793ad by Richard Eisenberg at 2020-08-25T07:37:40-04:00
Use tcView, not coreView, in the pure unifier.
Addresses a lingering point within #11715.
- - - - -
fb77207a by Simon Peyton Jones at 2020-08-25T07:38:16-04:00
Use LIdP rather than (XRec p (IdP p))
This patch mainly just replaces use of
XRec p (IdP p)
with
LIdP p
One slightly more significant change is to parameterise
HsPatSynDetails over the pass rather than the argument type,
so that it's uniform with HsConDeclDetails and HsConPatDetails.
I also got rid of the dead code GHC.Hs.type.conDetailsArgs
But this is all just minor refactoring. No change in functionality.
- - - - -
8426a136 by Krzysztof Gogolewski at 2020-08-25T07:38:54-04:00
Add a test for #18585
- - - - -
2d635a50 by Takenobu Tani at 2020-08-26T04:50:21-04:00
linters: Make CPP linter skip image files
This patch adds an exclusion rule for `docs/users_guide/images`,
to avoid lint errors of PDF files.
- - - - -
b7d98cb2 by Takenobu Tani at 2020-08-26T04:50:21-04:00
users-guide: Color the logo on the front page of the PDF
This patch updates the logo with a recent color scheme.
This affects only the PDF version of the user's guide.
See also:
* https://mail.haskell.org/pipermail/ghc-devs/2020-August/019139.html
* https://gitlab.haskell.org/ghc/ghc/-/wikis/logo
- - - - -
0b17fa18 by Sylvain Henry at 2020-08-26T04:50:58-04:00
Refactor UnitId pretty-printing
When we pretty-print a UnitId for the user, we try to map it back to its
origin package name, version and component to print
"package-version:component" instead of some hash.
The UnitId type doesn't carry these information, so we have to look into
a UnitState to find them. This is why the Outputable instance of
UnitId used `sdocWithDynFlags` in order to access the `unitState` field
of DynFlags.
This is wrong for several reasons:
1. The DynFlags are accessed when the message is printed, not when it is
generated. So we could imagine that the unitState may have changed
in-between. Especially if we want to allow unit unloading.
2. We want GHC to support several independent sessions at once, hence
several UnitState. The current approach supposes there is a unique
UnitState as a UnitId doesn't indicate which UnitState to use.
See the Note [Pretty-printing UnitId] in GHC.Unit for the new approach
implemented by this patch.
One step closer to remove `sdocDynFlags` field from `SDocContext`
(#10143).
Fix #18124.
Also fix some Backpack code to use SDoc instead of String.
- - - - -
dc476a50 by Sylvain Henry at 2020-08-26T04:51:35-04:00
Bignum: fix BigNat subtraction (#18604)
There was a confusion between the boolean expected by
withNewWordArrayTrimedMaybe and the boolean returned by subtracting
functions.
- - - - -
fcb10b6c by Peter Trommler at 2020-08-26T10:42:30-04:00
PPC and X86: Portable printing of IEEE floats
GNU as and the AIX assembler support floating point literals.
SPARC seems to have support too but I cannot test on SPARC.
Curiously, `doubleToBytes` is also used in the LLVM backend.
To avoid endianness issues when cross-compiling float and double literals
are printed as C-style floating point values. The assembler then takes
care of memory layout and endianness.
This was brought up in #18431 by @hsyl20.
- - - - -
770100e0 by Krzysztof Gogolewski at 2020-08-26T10:43:13-04:00
primops: Remove Monadic and Dyadic categories
There were four categories of primops: Monadic, Dyadic, Compare, GenPrimOp.
The compiler does not treat Monadic and Dyadic in any special way,
we can just replace them with GenPrimOp.
Compare is still used in isComparisonPrimOp.
- - - - -
01ff8c89 by Aditya Gupta at 2020-08-27T14:19:26-04:00
Consolidate imports in getMinimalImports (#18264)
- - - - -
bacccb73 by Ryan Scott at 2020-08-27T14:20:01-04:00
Make {hsExpr,hsType,pat}NeedsParens aware of boxed 1-tuples
`hsExprNeedsParens`, `hsTypeNeedsParens`, and `patNeedsParens`
previously assumed that all uses of explicit tuples in the source
syntax never need to be parenthesized. This is true save for one
exception: boxed one-tuples, which use the `Solo` data type from
`GHC.Tuple` instead of special tuple syntax. This patch adds the
necessary logic to the three `*NeedsParens` functions to handle
`Solo` correctly.
Fixes #18612.
- - - - -
c6f50cea by Krzysztof Gogolewski at 2020-08-28T02:22:36-04:00
Add missing primop documentation (#18454)
- Add three pseudoops to primops.txt.pp, so that Haddock renders
the documentation
- Update comments
- Remove special case for "->" - it's no longer exported from GHC.Prim
- Remove reference to Note [Compiling GHC.Prim] - the ad-hoc fix is no
longer there after updates to levity polymorphism.
- Document GHC.Prim
- Remove the comment that lazy is levity-polymorphic.
As far as I can tell, it never was: in 80e399639,
only the unfolding was given an open type variable.
- Remove haddock hack in GHC.Magic - no longer neccessary after
adding realWorld# to primops.txt.pp.
- - - - -
f065b6b0 by Tamar Christina at 2020-08-28T02:23:13-04:00
Fix use distro toolchian
- - - - -
4517a382 by Tamar Christina at 2020-08-28T02:23:13-04:00
document how build system find toolchains on Windows
- - - - -
329f7cb9 by Ben Gamari at 2020-08-31T22:59:14-04:00
base: Better error message on invalid getSystemTimerManager call
Previously we would produce a rather unhelpful pattern match failure
error in the case where the user called `getSystemTimerManager` in a
program which isn't built with `-threaded`. This understandably confused
the user in #15616.
Fixes #15616.
- - - - -
f6d70a8f by Roland Senn at 2020-08-31T22:59:50-04:00
Add tests for #15617.
Avoid a similar regression in the future.
- - - - -
e5969fd0 by Roland Senn at 2020-08-31T23:00:27-04:00
Add additional tests for #18172 (Followup MR 3543)
There was still one active discussion [thread](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3543#note_284325) when MR !3543 got merged.
This MR adds the requested tests exercising the changes in
`compiler/GHC/HsToCore/Match/Literal.hs:warnAboutEmptyEnumerations` and its sub-functions.
- - - - -
fe18b482 by Ben Gamari at 2020-08-31T23:01:02-04:00
Bump Win32 and process submodules
- - - - -
2da93308 by Sylvain Henry at 2020-08-31T23:01:39-04:00
Hadrian: fix slow-validate flavour (#18586)
- - - - -
85e13008 by Andreas Klebinger at 2020-08-31T23:02:15-04:00
Update dominator code with fixes from the dom-lt package.
Two bugs turned out in the package that have been fixed since.
This MR includes this fixes in the GHC port of the code.
- - - - -
dffb38fa by Andreas Klebinger at 2020-08-31T23:02:15-04:00
Dominators.hs: Use unix line endings
- - - - -
6189cc04 by Moritz Angermann at 2020-08-31T23:02:50-04:00
[fixup 3433] move debugBelch into IF_DEBUG(linker)
The commit in dff1cb3d9c111808fec60190747272b973547c52 incorrectly left
the `debugBelch` function without a comment or IF_DEBUG(linker,)
decoration. This rectifies it.
Needs at least a 8.10 backport, as it was backported in 6471cc6aff80d5deebbdb1bf7b677b31ed2af3d5
- - - - -
bcb68a3f by Sylvain Henry at 2020-08-31T23:03:27-04:00
Don't store HomeUnit in UnitConfig
Allow the creation of a UnitConfig (hence of a UnitState) without having
a HomeUnit. It's required for #14335.
- - - - -
0a372387 by Sylvain Henry at 2020-08-31T23:04:04-04:00
Fix documentation and fix "check" bignum backend (#18604)
- - - - -
eb85f125 by Moritz Angermann at 2020-08-31T23:04:39-04:00
Set the dynamic-system-linker flag to Manual
This flag should be user controllable, hence Manual: True.
- - - - -
380ef845 by Sven Tennie at 2020-08-31T23:05:14-04:00
Ignore more files
Ignore files from "new style" cabal builds (dist-newstyle folders) and
from clangd (C language server).
- - - - -
74a7fbff by Takenobu Tani at 2020-08-31T23:05:51-04:00
Limit upper version of Happy for ghc-9.0 and earlier (#18620)
This patch adds the upper bound of a happy version for ghc-9.0
and earlier.
Currently, we can't use happy-1.20.0 for ghc-9.0.
See #18620.
- - - - -
a4473f02 by Takenobu Tani at 2020-08-31T23:05:51-04:00
Limit upper version of Happy for ghc-9.2 (#18620)
This patch adds the upper bound of a happy version for ghc-9.2.
Currently, We can use happy-1.19 or happy-1.20 for ghc-9.2.
See #18620.
- - - - -
a8a2568b by Sylvain Henry at 2020-08-31T23:06:28-04:00
Bignum: add BigNat compat functions (#18613)
- - - - -
884245dd by Sylvain Henry at 2020-09-01T12:39:36-04:00
Fix FastString lexicographic ordering (fix #18562)
- - - - -
4b4fbc58 by Sylvain Henry at 2020-09-01T12:39:36-04:00
Remove "Ord FastString" instance
FastStrings can be compared in 2 ways: by Unique or lexically. We don't
want to bless one particular way with an "Ord" instance because it leads
to bugs (#18562) or to suboptimal code (e.g. using lexical comparison
while a Unique comparison would suffice).
UTF-8 encoding has the advantage that sorting strings by their encoded
bytes also sorts them by their Unicode code points, without having to
decode the actual code points. BUT GHC uses Modified UTF-8 which
diverges from UTF-8 by encoding \0 as 0xC080 instead of 0x00 (to avoid
null bytes in the middle of a String so that the string can still be
null-terminated). This patch adds a new `utf8CompareShortByteString`
function that performs sorting by bytes but that also takes Modified
UTF-8 into account. It is much more performant than decoding the strings
into [Char] to perform comparisons (which we did in the previous patch).
Bump haddock submodule
- - - - -
b4edcde7 by Ben Gamari at 2020-09-01T14:53:42-04:00
testsuite: Add broken test for #18302
- - - - -
bfab2a30 by Sebastian Graf at 2020-09-02T15:54:55-04:00
Turn on -XMonoLocalBinds by default (#18430)
And fix the resulting type errors.
Co-authored-by: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Metric Decrease:
parsing001
- - - - -
c30cc0e9 by David Feuer at 2020-09-02T15:55:31-04:00
Remove potential space leak from Data.List.transpose
Previously, `transpose` produced a list of heads
and a list of tails independently. This meant that
a function using only some heads, and only some tails,
could potentially leak space. Use `unzip` to work
around the problem by producing pairs and selector
thunks instead. Time and allocation behavior will
be worse, but there should be no more leak potential.
- - - - -
ffc3da47 by Sylvain Henry at 2020-09-02T15:56:11-04:00
Remove outdated note
- - - - -
85e62123 by Sylvain Henry at 2020-09-02T15:56:48-04:00
Bignum: add missing compat import/export functions
- - - - -
397c2b03 by Ben Gamari at 2020-09-03T17:31:47-04:00
configure: Work around Raspbian's silly packaging decisions
See #17856.
- - - - -
4891c18a by Kathryn Spiers at 2020-09-03T17:32:24-04:00
expected-undocumented-flags remove kill flags
It looks like the flags were removed in https://gitlab.haskell.org/ghc/ghc/-/commit/3e27205a66b06a4501d87eb31e285eadbc693eb7
and can safely be removed here
- - - - -
1d6d6488 by Sylvain Henry at 2020-09-04T16:24:20-04:00
Don't rely on CLabel's Outputable instance in CmmToC
This is in preparation of the removal of sdocWithDynFlags (#10143),
hence of the refactoring of CLabel's Outputable instance.
- - - - -
89ce7cdf by Sylvain Henry at 2020-09-04T16:24:59-04:00
DynFlags: use Platform in foldRegs*
- - - - -
220ad8d6 by Sylvain Henry at 2020-09-04T16:24:59-04:00
DynFlags: don't pass DynFlags to cmmImplementSwitchPlans
- - - - -
c1e54439 by Ryan Scott at 2020-09-04T16:25:35-04:00
Introduce isBoxedTupleDataCon and use it to fix #18644
The code that converts promoted tuple data constructors to
`IfaceType`s in `GHC.CoreToIface` was using `isTupleDataCon`, which
conflates boxed and unboxed tuple data constructors. To avoid this,
this patch introduces `isBoxedTupleDataCon`, which is like
`isTupleDataCon` but only works for _boxed_ tuple data constructors.
While I was in town, I was horribly confused by the fact that there
were separate functions named `isUnboxedTupleCon` and
`isUnboxedTupleTyCon` (similarly, `isUnboxedSumCon` and
`isUnboxedSumTyCon`). It turns out that the former only works for
data constructors, despite its very general name! I opted to rename
`isUnboxedTupleCon` to `isUnboxedTupleDataCon` (similarly, I renamed
`isUnboxedSumCon` to `isUnboxedSumDataCon`) to avoid this potential
confusion, as well as to be more consistent with
the naming convention I used for `isBoxedTupleDataCon`.
Fixes #18644.
- - - - -
07bdcac3 by GHC GitLab CI at 2020-09-04T22:26:25-04:00
configure: Avoid hard-coded ld path on Windows
The fix to #17962 ended up regressing on Windows as it failed to
replicate the logic responsible for overriding the toolchain paths on
Windows. This resulted in a hard-coded path to a directory that likely
doesn't exist on the user's system (#18550).
- - - - -
0be8e746 by Benjamin Maurer at 2020-09-04T22:27:01-04:00
Documented the as of yet undocumented '--print-*' GHC flags,
as well as `-split-objs`, since that is related to
`--print-object-splitting-supported`.
See #18641
- - - - -
4813486f by Sylvain Henry at 2020-09-04T22:27:44-04:00
Move Hadrian's wiki pages in tree (fix #16165)
Only the debugging page contains interesting stuff. Some of this stuff
looks old (e.g. recommending "cabal install")...
- - - - -
7980ae23 by GHC GitLab CI at 2020-09-05T14:50:52-04:00
rts: Consistently use stgMallocBytes instead of malloc
This can help in debugging RTS memory leaks since all allocations go
through the same interface.
- - - - -
67059893 by Ben Gamari at 2020-09-05T14:51:27-04:00
configure: Fix whitespace
- - - - -
be2cc0ad by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: More intelligent detection of locale availability
Previously ci.sh would unconditionally use C.UTF-8. However, this fails
on Centos 7, which appears not to provide this locale. Now we first try
C.UTF-8, then try en_US.UTF-8, then fail.
Works around #18607.
- - - - -
15dca847 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Rename RELEASE variable to RELEASE_JOB
This interfered with the autoconf variable of the same name, breaking
pre-release builds.
- - - - -
bec0d170 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Bump Windows toolchain version
This should have been done when we bumped the bootstrap compiler to
8.8.4.
- - - - -
9fbaee21 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Drop Windows make job
These are a significant burden on our CI resources and end up failing
quite often due to #18274. Here I drop the make jobs during
validaion; it is now run only during the nightly builds.
- - - - -
869f6e19 by Ben Gamari at 2020-09-05T14:51:27-04:00
testsuite: Drop Windows-specific output for parseTree
The normalise_slashes normaliser should handle this.
- - - - -
2c9f743c by Ben Gamari at 2020-09-05T14:51:28-04:00
testsuite: Mark T5975[ab] as broken on Windows
Due to #7305.
- - - - -
643785e3 by Ben Gamari at 2020-09-05T14:51:28-04:00
gitlab-ci: Fix typo
A small typo in a rule regular expression.
- - - - -
c5413fc6 by Wander Hillen at 2020-09-07T09:33:54-04:00
Add clarification regarding poll/kqueue flags
- - - - -
10434d60 by Ben Gamari at 2020-09-07T09:34:32-04:00
gitlab-ci: Configure bignum backend in Hadrian builds
- - - - -
d4bc9f0d by Ben Gamari at 2020-09-07T09:34:32-04:00
gitlab-ci: Use hadrian builds for Windows release artifacts
- - - - -
4ff93292 by Moritz Angermann at 2020-09-07T21:18:39-04:00
[macOS] improved runpath handling
In b592bd98ff25730bbe3c13d6f62a427df8c78e28 we started using
-dead_strip_dylib on macOS when lining dynamic libraries and binaries.
The underlying reason being the Load Command Size Limit in macOS
Sierra (10.14) and later.
GHC will produce @rpath/libHS... dependency entries together with a
corresponding RPATH entry pointing to the location of the libHS...
library. Thus for every library we produce two Load Commands. One to
specify the dependent library, and one with the path where to find it.
This makes relocating libraries and binaries easier, as we just need to
update the RPATH entry with the install_name_tool. The dynamic linker
will then subsitute each @rpath with the RPATH entries it finds in the
libraries load commands or the environement, when looking up @rpath
relative libraries.
-dead_strip_dylibs intructs the linker to drop unused libraries. This in
turn help us reduce the number of referenced libraries, and subsequently
the size of the load commands. This however does not remove the RPATH
entries. Subsequently we can end up (in extreme cases) with only a
single @rpath/libHS... entry, but 100s or more RPATH entries in the Load
Commands.
This patch rectifies this (slighly unorthodox) by passing *no* -rpath
arguments to the linker at link time, but -headerpad 8000. The
headerpad argument is in hexadecimal and the maxium 32k of the load
command size. This tells the linker to pad the load command section
enough for us to inject the RPATHs later. We then proceed to link the
library or binary with -dead_strip_dylibs, and *after* the linking
inspect the library to find the left over (non-dead-stripped)
dependencies (using otool). We find the corresponding RPATHs for each
@rpath relative dependency, and inject them into the library or binary
using the install_name_tool. Thus achieving a deadstripped dylib (and
rpaths) build product.
We can not do this in GHC, without starting to reimplement a dynamic
linker as we do not know which symbols and subsequently libraries are
necessary.
Commissioned-by: Mercury Technologies, Inc. (mercury.com)
- - - - -
df04b81e by Sylvain Henry at 2020-09-07T21:19:20-04:00
Move DynFlags test into updateModDetailsIdInfos's caller (#17957)
- - - - -
ea1cbb8f by Ben Gamari at 2020-09-08T15:42:02-04:00
rts: Add stg_copyArray_barrier to RtsSymbols list
It's incredible that this wasn't noticed until now.
- - - - -
d7b2f799 by Daishi Nakajima at 2020-09-08T15:42:41-04:00
testsuite: Output performance test results in tabular format
this was suggested in #18417.
Change the print format of the values.
* Shorten commit hash
* Reduce precision of the "Value" field
* Shorten metrics name
* e.g. runtime/bytes allocated -> run/alloc
* Shorten "MetricsChange"
* e.g. unchanged -> unch, increased -> incr
And, print the baseline environment if there are baselines that were
measured in a different environment than the current environment.
If all "Baseline commit" are the same, print it once.
- - - - -
44472daf by Ryan Scott at 2020-09-08T15:43:16-04:00
Make the forall-or-nothing rule only apply to invisible foralls (#18660)
This fixes #18660 by changing `isLHsForAllTy` to
`isLHsInvisForAllTy`, which is sufficient to make the
`forall`-or-nothing rule only apply to invisible `forall`s. I also
updated some related documentation and Notes while I was in the
neighborhood.
- - - - -
0c61cbff by Ben Gamari at 2020-09-08T15:43:54-04:00
gitlab-ci: Handle distributions without locales
Previously we would assume that the `locale` utility exists. However,
this is not so on Alpine as musl's locale support is essentially
non-existent.
(cherry picked from commit 17cdb7ac3b557a245fee1686e066f9f770ddc21e)
- - - - -
d989c842 by Ben Gamari at 2020-09-08T15:43:55-04:00
gitlab-ci: Accept Centos 7 C.utf8 locale
Centos apparently has C.utf8 rather than C.UTF-8.
(cherry picked from commit d9f85dd25a26a04d3485470afb3395ee2dec6464)
- - - - -
e5a2899c by John Ericson at 2020-09-09T00:46:05-04:00
Use "to" instead of "2" in internal names of conversion ops
Change the constructors for the primop union, and also names of the
literal conversion functions.
"2" runs into trouble when we need to do conversions from fixed-width
types, and end up with thing like "Int642Word".
Only the names internal to GHC are changed, as I don't want to worry
about breaking changes ATM.
- - - - -
822f1057 by Ryan Scott at 2020-09-09T00:46:41-04:00
Postpone associated tyfam default checks until after typechecking
Previously, associated type family defaults were validity-checked
during typechecking. Unfortunately, the error messages that these
checks produce run the risk of printing knot-tied type constructors,
which will cause GHC to diverge. In order to preserve the current
error message's descriptiveness, this patch postpones these validity
checks until after typechecking, which are now located in the new
function `GHC.Tc.Validity.checkValidAssocTyFamDeflt`.
Fixes #18648.
- - - - -
8c892689 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add OptCoercionOpts
Use OptCoercionOpts to avoid threading DynFlags all the way down to
GHC.Core.Coercion.Opt
- - - - -
3f32a9c0 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add UnfoldingOpts and SimpleOpts
Milestone: after this patch, we only use 'unsafeGlobalDynFlags' for the
state hack and for debug in Outputable.
- - - - -
b3df72a6 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add sm_pre_inline field into SimplMode (#17957)
It avoids passing and querying DynFlags down in the simplifier.
- - - - -
ffae5792 by Sylvain Henry at 2020-09-09T11:19:24-04:00
Add comments about sm_dflags and simpleOptExpr
- - - - -
7911d0d9 by Alan Zimmerman at 2020-09-09T11:20:03-04:00
Remove GENERATED pragma, as it is not being used
@alanz pointed out on ghc-devs that the payload of this pragma does
not appear to be used anywhere.
I (@bgamari) did some digging and traced the pragma's addition back to
d386e0d2 (way back in 2006!).
It appears that it was intended to be used by code generators for use
in informing the code coveraging checker about generated code
provenance. When it was added it used the pragma's "payload" fields as
source location information to build an "ExternalBox". However, it
looks like this was dropped a year later in 55a5d8d9. At this point
it seems like the pragma serves no useful purpose.
Given that it also is not documented, I think we should remove it.
Updates haddock submodule
Closes #18639
- - - - -
5aae5b32 by Ben Gamari at 2020-09-09T18:31:40-04:00
gitlab-ci: Bump Docker images
We now generate our Docker images via Dhall definitions, as described in
ghc/ci-images!52. Additionally, we are far more careful about where tools
come from, using the ALEX, HAPPY, HSCOLOR, and GHC environment variables
(set in the Dockerfiles) to find bootstrapping tools.
- - - - -
4ce9fe88 by Ben Gamari at 2020-09-09T18:31:40-04:00
hadrian: Fix leakage of GHC in PATH into build
Previously hadrian would use GHC on PATH when configuring packages (or
fail if there is no such GHC). Fix this. Unfortunately this runs into
another bug in Cabal which we workaround.
- - - - -
291a15dd by Ben Gamari at 2020-09-09T18:31:40-04:00
utils: Bump cabal-version of hp2ps and unlit
- - - - -
4798caa0 by David Himmelstrup at 2020-09-09T18:32:16-04:00
rts comment: RTS_TICKY_SYMBOLS moved from rts/Linker.c to rts/RtsSymbols.c
- - - - -
67ce72da by Sebastian Graf at 2020-09-10T10:35:33-04:00
Add long-distance info for pattern bindings (#18572)
We didn't consider the RHS of a pattern-binding before, which led to
surprising warnings listed in #18572.
As can be seen from the regression test T18572, we get the expected
output now.
- - - - -
1207576a by Sebastian Graf at 2020-09-10T10:35:33-04:00
PmCheck: Big refactor using guard tree variants more closely following source syntax (#18565)
Previously, we desugared and coverage checked plain guard trees as
described in Lower Your Guards. That caused (in !3849) quite a bit of
pain when we need to partially recover tree structure of the input
syntax to return covered sets for long-distance information, for
example.
In this refactor, I introduced a guard tree variant for each relevant
source syntax component of a pattern-match (mainly match groups, match,
GRHS, empty case, pattern binding). I made sure to share as much
coverage checking code as possible, so that the syntax-specific checking
functions are just wrappers around the more substantial checking
functions for the LYG primitives (`checkSequence`, `checkGrds`).
The refactoring payed off in clearer code and elimination of all panics
related to assumed guard tree structure and thus fixes #18565.
I also took the liberty to rename and re-arrange the order of functions
and comments in the module, deleted some dead and irrelevant Notes,
wrote some new ones and gave an overview module haddock.
- - - - -
95455982 by GHC GitLab CI at 2020-09-10T10:36:09-04:00
hadrian: Don't include -fdiagnostics-color in argument hash
Otherwise the input hash will vary with whether colors are requested,
which changed with `isatty`.
Fixes #18672.
- - - - -
6abe4a1c by Sebastian Graf at 2020-09-10T17:02:00+02:00
.gitignore *.hiedb files
- - - - -
3777be14 by Sebastian Graf at 2020-09-10T17:03:12+02:00
PmCheck: Handle ⊥ and strict fields correctly (#18341)
In #18341, we discovered an incorrect digression from Lower Your Guards.
This MR changes what's necessary to support properly fixing #18341.
In particular, bottomness constraints are now properly tracked in the
oracle/inhabitation testing, as an additional field
`vi_bot :: Maybe Bool` in `VarInfo`. That in turn allows us to
model newtypes as advertised in the Appendix of LYG and fix #17725.
Proper handling of ⊥ also fixes #17977 (once again) and fixes #18670.
For some reason I couldn't follow, this also fixes #18273.
I also added a couple of regression tests that were missing. Most of
them were already fixed before.
In summary, this patch fixes #18341, #17725, #18273, #17977 and #18670.
Metric Decrease:
T12227
- - - - -
1bd28931 by David Himmelstrup at 2020-09-11T09:59:43-04:00
Define TICKY_TICKY when compiling cmm RTS files.
- - - - -
15e67801 by David Himmelstrup at 2020-09-11T09:59:43-04:00
Fix typos in TICKY_TICKY symbol names.
- - - - -
8a5a91cb by David Himmelstrup at 2020-09-11T09:59:43-04:00
Enable TICKY_TICKY for debug builds when building with makefiles.
- - - - -
fc965c09 by Sandy Maguire at 2020-09-12T00:31:36-04:00
Add clamp function to Data.Ord
- - - - -
fb6e29e8 by Sandy Maguire at 2020-09-12T00:31:37-04:00
Add tests
- - - - -
2a942285 by Sebastian Graf at 2020-09-12T00:32:13-04:00
PmCheck: Disattach COMPLETE pragma lookup from TyCons
By not attaching COMPLETE pragmas with a particular TyCon and instead
assume that every COMPLETE pragma is applicable everywhere, we can
drastically simplify the logic that tries to initialise available
COMPLETE sets of a variable during the pattern-match checking process,
as well as fixing a few bugs.
Of course, we have to make sure not to report any of the
ill-typed/unrelated COMPLETE sets, which came up in a few regression
tests.
In doing so, we fix #17207, #18277 and #14422.
There was a metric decrease in #18478 by ~20%.
Metric Decrease:
T18478
- - - - -
389a6683 by Ben Gamari at 2020-09-12T00:32:49-04:00
hadrian: Pass input file to makeindex
Strangely I find that on Alpine (and apparently only on Alpine) the
latex makeindex command expects to be given a filename, lest it reads
from stdin.
- - - - -
853d121a by Ryan Scott at 2020-09-12T00:33:25-04:00
Don't quote argument to Hadrian's test-env flag (#18656)
Doing so causes the name of the test environment to gain an extra
set of double quotes, which changes the name entirely.
Fixes #18656.
- - - - -
8440b5fa by Krzysztof Gogolewski at 2020-09-12T00:33:25-04:00
Make sure we can read past perf notes
See #18656.
- - - - -
2157be52 by theobat at 2020-09-12T21:27:04-04:00
Avoid iterating twice in `zipTyEnv` (#18535)
zipToUFM is a new function to replace `listToUFM (zipEqual ks vs)`.
An explicit recursion is preferred due to the sensible nature of fusion.
T12227 -6.0%
T12545 -12.3%
T5030 -9.0%
T9872a -1.6%
T9872b -1.6%
T9872c -2.0%
-------------------------
Metric Decrease:
T12227
T12545
T5030
T9872a
T9872b
T9872c
-------------------------
- - - - -
69ea2fee by Sebastian Graf at 2020-09-12T21:27:40-04:00
Make `tcCheckSatisfiability` incremental (#18645)
By taking and returning an `InertSet`.
Every new `TcS` session can then pick up where a prior session left with
`setTcSInerts`.
Since we don't want to unflatten the Givens (and because it leads to
infinite loops, see !3971), we introduced a new variant of `runTcS`,
`runTcSInerts`, that takes and returns the `InertSet` and makes
sure not to unflatten the Givens after running the `TcS` action.
Fixes #18645 and #17836.
Metric Decrease:
T17977
T18478
- - - - -
a77e48d2 by Sebastian Graf at 2020-09-12T21:27:40-04:00
Extract definition of DsM into GHC.HsToCore.Types
`DsM` was previously defined in `GHC.Tc.Types`, along with `TcM`. But
`GHC.Tc.Types` is in the set of transitive dependencies of `GHC.Parser`,
a set which we aim to minimise. Test case `CountParserDeps` checks for
that.
Having `DsM` in that set means the parser also depends on the innards of
the pattern-match checker in `GHC.HsToCore.PmCheck.Types`, which is the
reason we have that module in the first place.
In the previous commit, we represented the `TyState` by an `InertSet`,
but that pulls the constraint solver as well as 250 more modules into
the set of dependencies, triggering failure of `CountParserDeps`.
Clearly, we want to evolve the pattern-match checker (and the desugarer)
without being concerned by this test, so this patch includes a small
refactor that puts `DsM` into its own module.
- - - - -
fd5d622a by Sebastian Graf at 2020-09-12T21:27:40-04:00
Hackily decouple the parser from the desugarer
In a hopefully temporary hack, I re-used the idea from !1957 of using a
nullary type family to break the dependency from GHC.Driver.Hooks on the
definition of DsM ("Abstract Data").
This in turn broke the last dependency from the parser to the desugarer.
More details in `Note [The Decoupling Abstract Data Hack]`.
In the future, we hope to undo this hack again in favour of breaking the
dependency from the parser to DynFlags altogether.
- - - - -
35a7b7ec by Adam Sandberg Eriksson at 2020-09-14T17:46:16-04:00
docs: -B rts option sounds the bell on every GC (#18351)
- - - - -
5ae8212c by Wander Hillen at 2020-09-14T17:46:54-04:00
Populate gitlab cache after building
- - - - -
a5ffb39a by Wander Hillen at 2020-09-14T17:46:54-04:00
Move ahead cabal cache restoration to before use of cabal
- - - - -
e8b37c21 by Wander Hillen at 2020-09-14T17:46:54-04:00
Do the hadrian rebuild multicore
- - - - -
07762eb5 by Wander Hillen at 2020-09-14T17:46:54-04:00
Also cache other hadrian builds
- - - - -
8610bcbe by DenisFrezzato at 2020-09-15T15:19:08-04:00
Fix rtsopts documentation
- - - - -
c7182a5c by Simon Peyton Jones at 2020-09-15T15:19:44-04:00
Care with implicit-parameter superclasses
Two bugs, #18627 and #18649, had the same cause: we were not
account for the fact that a constaint tuple might hide an implicit
parameter.
The solution is not hard: look for implicit parameters in
superclasses. See Note [Local implicit parameters] in
GHC.Core.Predicate.
Then we use this new function in two places
* The "short-cut solver" in GHC.Tc.Solver.Interact.shortCutSolver
which simply didn't handle implicit parameters properly at all.
This fixes #18627
* The specialiser, which should not specialise on implicit parameters
This fixes #18649
There are some lingering worries (see Note [Local implicit
parameters]) but things are much better.
- - - - -
0f3884b0 by Zubin Duggal at 2020-09-15T15:20:23-04:00
Export enrichHie from GHC.Iface.Ext.Ast
This is useful for `ghcide`
- - - - -
b3143f5a by Sylvain Henry at 2020-09-15T15:21:06-04:00
Enhance metrics output
- - - - -
4283feaa by Ryan Scott at 2020-09-15T15:21:43-04:00
Introduce and use DerivClauseTys (#18662)
This switches `deriv_clause_tys` so that instead of using a list of
`LHsSigType`s to represent the types in a `deriving` clause, it now
uses a sum type. `DctSingle` represents a `deriving` clause with no
enclosing parentheses, while `DctMulti` represents a clause with
enclosing parentheses. This makes pretty-printing easier and avoids
confusion between `HsParTy` and the enclosing parentheses in
`deriving` clauses, which are different semantically.
Fixes #18662.
- - - - -
90229c4b by Ryan Scott at 2020-09-16T04:53:22-04:00
Include -f{write,validate}-ide-info in the User's Guide flag reference
Previously, these were omitted from the flag reference due to a
layout oversight in `docs/users_guide/flags.{rst,py}`.
Fixes #18426.
- - - - -
ce42e187 by Ben Gamari at 2020-09-16T04:53:59-04:00
rts: Fix erroneous usage of vsnprintf
As pointed out in #18685, this should be snprintf not vsnprintf. This
appears to be due to a cut-and-paste error.
Fixes #18658.
- - - - -
b695e7d7 by Sylvain Henry at 2020-09-16T04:54:38-04:00
Rename ghci flag into internal-interpreter
"ghci" as a flag name was confusing because it really enables the
internal-interpreter. Even the ghci library had a "ghci" flag...
- - - - -
8af954d2 by Sylvain Henry at 2020-09-16T04:55:17-04:00
Make ghc-boot reexport modules from ghc-boot-th
Packages don't have to import both ghc-boot and ghc-boot-th. It makes
the dependency graph easier to understand and to refactor.
- - - - -
6baa67f5 by Adam Sandberg Eriksson at 2020-09-16T07:45:47-04:00
docs: correct haddock reference
[skip ci]
- - - - -
7cf09ab0 by Simon Peyton Jones at 2020-09-17T01:27:25-04:00
Do absence analysis on stable unfoldings
Ticket #18638 showed that Very Bad Things happen if we fail
to do absence analysis on stable unfoldings. It's all described
in Note [Absence analysis for stable unfoldings and RULES].
I'm a bit surprised this hasn't bitten us before. Fortunately
the fix is pretty simple.
- - - - -
76d3bcbc by Leif Metcalf at 2020-09-17T01:28:01-04:00
Replace deprecated git --recursive
The --recursive flag of git-clone has been replaced by the
--recurse-submodules flag since git 1.7.4, released in 2011.
- - - - -
da8f4ddd by Richard Eisenberg at 2020-09-17T01:28:38-04:00
Document IfaceTupleTy
- - - - -
3c94c816 by HaskellMouse at 2020-09-17T08:49:51-04:00
Added explicit fixity to (~).
Solves #18252
- - - - -
b612e396 by Cary Robbins at 2020-09-17T08:50:30-04:00
Make the 'IsString (Const a b)' instance polykinded on 'b'
- - - - -
8d0c26c4 by Ben Gamari at 2020-09-17T08:51:08-04:00
rts/win32: Fix missing #include's
These slipped through CI.
- - - - -
76009ec8 by Ben Gamari at 2020-09-17T08:51:08-04:00
Bump Win32 submodule to 2.9.0.0
Also bumps Cabal, directory
- - - - -
147bb598 by Ben Gamari at 2020-09-17T08:51:08-04:00
Bump version to 9.0
Bumps haskeline and haddock submodules.
(cherry picked from commit f218cfc92f7b1a1e01190851972bb9a0e0f3c682)
- - - - -
5c7387f6 by Leif Metcalf at 2020-09-17T08:51:43-04:00
Make Z-encoding comment into a note
- - - - -
c12b3041 by Leif Metcalf at 2020-09-17T08:51:43-04:00
Cosmetic
- - - - -
4f461e1a by Vladislav Zavialov at 2020-09-17T08:52:19-04:00
Parser.y: clarify treatment of @{-# UNPACK #-}
Before this patch, we had this parser production:
ftype : ...
| ftype PREFIX_AT tyarg { ... }
And 'tyarg' is defined as follows:
tyarg : atype { ... }
| unpackedness atype { ... }
So one might get the (false) impression that that parser production is
intended to parse things like:
F @{-# UNPACK #-} X
However, the lexer wouldn't produce PREFIX_AT followed by 'unpackedness',
as the '@' operator followed by '{-' is not considered prefix.
Thus there's no point using 'tyarg' after PREFIX_AT,
and a simple 'atype' will suffice:
ftype : ...
| ftype PREFIX_AT atype { ... }
This change has no user-facing consequences. It just makes the grammar a
bit more clear.
- - - - -
9dec8600 by Benjamin Maurer at 2020-09-17T08:52:56-04:00
Documented '-m' flags for machine specific instruction extensions.
See #18641 'Documenting the Expected Undocumented Flags'
- - - - -
ca48076a by Sylvain Henry at 2020-09-17T20:04:08-04:00
Introduce OutputableP
Some types need a Platform value to be pretty-printed: CLabel, Cmm
types, instructions, etc.
Before this patch they had an Outputable instance and the Platform value
was obtained via sdocWithDynFlags. It meant that the *renderer* of the
SDoc was responsible of passing the appropriate Platform value (e.g. via
the DynFlags given to showSDoc). It put the burden of passing the
Platform value on the renderer while the generator of the SDoc knows the
Platform it is generating the SDoc for and there is no point passing a
different Platform at rendering time.
With this patch, we introduce a new OutputableP class:
class OutputableP a where
pdoc :: Platform -> a -> SDoc
With this class we still have some polymorphism as we have with `ppr`
(i.e. we can use `pdoc` on a variety of types instead of having a
dedicated `pprXXX` function for each XXX type).
One step closer removing `sdocWithDynFlags` (#10143) and supporting
several platforms (#14335).
- - - - -
e45c8544 by Sylvain Henry at 2020-09-17T20:04:08-04:00
Generalize OutputableP
Add a type parameter for the environment required by OutputableP. It
avoids tying Platform with OutputableP.
- - - - -
37aa224a by Sylvain Henry at 2020-09-17T20:04:08-04:00
Add note about OutputableP
- - - - -
7f2785f2 by Sylvain Henry at 2020-09-17T20:04:08-04:00
Remove pprPrec from Outputable (unused)
- - - - -
b689f3db by Sylvain Henry at 2020-09-17T20:04:46-04:00
Bignum: add clamping naturalToWord (fix #18697)
- - - - -
0799b3de by Ben Gamari at 2020-09-18T15:55:50-04:00
rts/nonmoving: Add missing STM write barrier
When updating a TRec for a TVar already part of a transaction we
previously neglected to add the old value to the update remembered set.
I suspect this was the cause of #18587.
- - - - -
c4921349 by Ben Gamari at 2020-09-18T15:56:25-04:00
rts: Refactor foreign export tracking
This avoids calling `libc` in the initializers which are responsible for
registering foreign exports. We believe this should avoid the corruption
observed in #18548.
See Note [Tracking foreign exports] in rts/ForeignExports.c for an
overview of the new scheme.
- - - - -
40dc9106 by Ben Gamari at 2020-09-18T15:56:25-04:00
rts: Refactor unloading of foreign export StablePtrs
Previously we would allocate a linked list cell for each foreign export.
Now we can avoid this by taking advantage of the fact that they are
already broken into groups.
- - - - -
45fa8218 by Simon Jakobi at 2020-09-19T06:57:36-04:00
Deprecate Data.Semigroup.Option
Libraries email: https://mail.haskell.org/pipermail/libraries/2018-April/028724.html
GHC issue: https://gitlab.haskell.org/ghc/ghc/issues/15028
Corresponding PRs for deepseq:
* https://github.com/haskell/deepseq/pull/55
* https://github.com/haskell/deepseq/pull/57
Bumps the deepseq submodule.
- - - - -
2229d570 by Vladislav Zavialov at 2020-09-19T15:47:24-04:00
Require happy >=1.20
- - - - -
a89c2fba by Ben Gamari at 2020-09-19T15:47:24-04:00
ci.sh: Enforce minimum happy/alex versions
Also, always invoke cabal-install to ensure that happy/alex symlinks are
up-to-date.
- - - - -
2f7ef2fb by Ben Gamari at 2020-09-19T15:47:24-04:00
gitlab-ci: Ensure that cabal-install overwrites existing executables
Previously cabal-install wouldn't overwrite toolchain executables if
they already existed (as they likely would due to caching).
- - - - -
ac213d26 by Ryan Scott at 2020-09-19T15:48:01-04:00
Wire in constraint tuples
This wires in the definitions of the constraint tuple classes. The
key changes are in:
* `GHC.Builtin.Types`, where the `mk_ctuple` function is used to
define constraint tuple type constructors, data constructors, and
superclass selector functions, and
* `GHC.Builtin.Uniques`. In addition to wiring in the `Unique`s for
constraint tuple type and data constructors, we now must wire in
the superclass selector functions. Luckily, this proves to be not
that challenging. See the newly added comments.
Historical note: constraint tuples used to be wired-in until about
five years ago, when commit 130e93aab220bdf14d08028771f83df210da340b
turned them into known-key names. This was done as part of a larger
refactor to reduce the number of special cases for constraint tuples,
but the commit message notes that the main reason that constraint
tuples were made known-key (as opposed to boxed/unboxed tuples, which
are wired in) is because it was awkward to wire in the superclass
selectors. This commit solves the problem of wiring in superclass
selectors.
Fixes #18635.
-------------------------
Metric Decrease:
T10421
T12150
T12227
T12234
T12425
T13056
T13253-spj
T18282
T18304
T5321FD
T5321Fun
T5837
T9961
Metric Decrease (test_env='x86_64-linux-deb9-unreg-hadrian'):
T12707
Metric Decrease (test_env='x86_64-darwin'):
T4029
-------------------------
- - - - -
e195dae6 by Wander Hillen at 2020-09-19T15:48:41-04:00
Export singleton function from Data.List
Data.OldList exports a monomorphized singleton function but
it is not re-exported by Data.List. Adding the export to
Data.List causes a conflict with a 14-year old function of the
same name and type by SPJ in GHC.Utils.Misc. We can't just remove
this function because that leads to a problems when building
GHC with a stage0 compiler that does not have singleton in
Data.List yet. We also can't hide the function in GHC.Utils.Misc
since it is not possible to hide a function from a module if the
module does not export the function. To work around this, all
places where the Utils.Misc singleton was used now use a qualified
version like Utils.singleton and in GHC.Utils.Misc we are very
specific about which version we export.
- - - - -
9c1b8ad9 by Sylvain Henry at 2020-09-19T15:49:19-04:00
Bump Stack resolver
- - - - -
d05d13ce by John Ericson at 2020-09-19T15:49:57-04:00
Cinch -fno-warn-name-shadowing down to specific GHCi module
- - - - -
f1accd00 by Sylvain Henry at 2020-09-19T15:49:57-04:00
Add quick-validate Hadrian flavour (quick + -Werror)
- - - - -
8f8d51f1 by Andreas Klebinger at 2020-09-19T15:50:33-04:00
Fix docs who misstated how the RTS treats size suffixes.
They are parsed as multiples of 1024. Not 1000. The docs
used to imply otherwise.
See decodeSize in rts/RtsFlags.c for the logic for this.
- - - - -
2ae0edbd by Andreas Klebinger at 2020-09-19T15:50:33-04:00
Fix a codeblock in ghci.rst
- - - - -
4df3aa95 by Ben Gamari at 2020-09-19T15:51:07-04:00
users guide: Fix various documentation issues
- - - - -
885ecd18 by Ben Gamari at 2020-09-19T15:51:07-04:00
hadrian: Fail on Sphinx syntax errors
Specifically the "Inline literal start-string without end-string"
warning, which typically means that the user neglected to separate
an inline code block from suffix text with a backslash.
- - - - -
b26cd867 by David Feuer at 2020-09-19T15:51:44-04:00
Unpack the MVar in Compact
The `MVar` lock in `Compact` was unnecessarily lazy, creating an extra indirection and wasting two words. Make it strict.
- - - - -
760307cf by Artyom Kuznetsov at 2020-09-19T15:52:21-04:00
Remove GADT self-reference check (#11554, #12081, #12174, fixes #15942)
Reverts 430f5c84dac1eab550110d543831a70516b5cac8
- - - - -
057db94c by Ben Gamari at 2020-09-19T15:52:56-04:00
rts: Drop field initializer on thread_basic_info_data_t
This struct has a number of fields and we only care that the value is
initialized with zeros. This eliminates the warnings noted in #17905.
- - - - -
913c91c3 by Andreas Klebinger at 2020-09-21T09:23:59-04:00
Make sizeExpr strict in the size threshold to facilitate WW.
- - - - -
29 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/linters/check-cpp.py
- README.md
- aclocal.m4
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types.hs-boot
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/Ppr.hs
- compiler/GHC/Cmm/Ppr/Decl.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8dbaa68a2d1944199ba206eaa77fd43fdea69f55...913c91c37daf16c4b2491dc3bfaf217e9c05006a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8dbaa68a2d1944199ba206eaa77fd43fdea69f55...913c91c37daf16c4b2491dc3bfaf217e9c05006a
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/20200921/d2ca823c/attachment-0001.html>
More information about the ghc-commits
mailing list