| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements GHC proposal 496, which allows record wildcards
to be used for nullary constructors, e.g.
data A = MkA1 | MkA2 { fld1 :: Int }
f :: A -> Int
f (MkA1 {..}) = 0
f (MkA2 {..}) = fld1
To achieve this, we add arity information to the record field
environment, so that we can accept a constructor which has no fields
while continuing to reject non-record constructors with more than 1
field. See Note [Nullary constructors and empty record wildcards],
as well as the more general overview in Note [Local constructor info in the renamer],
both in the newly introduced GHC.Types.ConInfo module.
Fixes #22161
|
| |
|
|
|
|
|
| |
We don't want to allow users to conjure up values of a `type data` type using
`tagToEnum#`, as these simply don't exist at the value level.
|
|
|
|
|
|
|
| |
The data constructors for a `type data` declaration don't exist at the value
level, so we don't want GHC to warn users to match on them.
Fixes #22964.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Data constructor wrappers only make sense for _value_-level data constructors,
but data constructors for `type data` declarations only exist at the _type_
level. This patch does the following:
* The criteria in `GHC.Types.Id.Make.mkDataConRep` for whether a data
constructor receives a wrapper now consider whether or not its parent data
type was declared with `type data`, omitting a wrapper if this is the case.
* Now that `type data` data constructors no longer receive wrappers, there is a
spot of code in `refineDefaultAlt` that panics when it encounters a value
headed by a `type data` type constructor. I've fixed this with a special case
in `refineDefaultAlt` and expanded `Note [Refine DEFAULT case alternatives]`
to explain why we do this.
Fixes #22948.
|
|
|
|
|
|
| |
Because of #20791, the plugins tests often fail. This is a temporary
fix to stop the tests from failing due to unflushed outputs on windows
and the explicit flush should be removed when #20791 is fixed.
|
|
|
|
| |
Fixes #22376.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
register mapping
The wasm NCG used to map CCCS to a wasm global, based on the
observation that CCCS is a transient register that's already handled
by thread state load/store logic, so it doesn't need to be backed by
the rCCCS field in the register table.
Unfortunately, this is wrong, since even when Cmm execution hasn't
yielded back to the scheduler, the Cmm code may call enterFunCCS,
which does use rCCCS.
This breaks cost centre profiling in a subtle way, resulting in
inaccurate stack traces in some test cases. The fix is simple though:
just remove the CCCS mapping.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It wasn't behaving right when inst_final=False, and the
function had no type variables
f :: Foo => Int
Rather a corner case, but we might as well do it right.
Fixes #22908
Unexpectedly, three test cases (all using :type in GHCi) got
slightly better output as a result:
T17403, T14796, T12447
|
|
|
|
|
|
|
|
|
|
| |
`libiserv` serves no purpose. As it depends on `ghci` and doesn't have
more dependencies than the `ghci` package, its code could live in the
`ghci` package too.
This commit also moves most of the code from the `iserv` program into
the `ghci` package as well so that it can be reused. This is especially
useful for the implementation of TH for the JS backend (#22261, !9779).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are
* recursive
* overloaded
So it's important to add an `INLINABLE` pragma to each so that they can be
specialised at the use site when the specific numeric type is known.
Adding these pragmas improves the LazyText replicate benchmark (see https://gitlab.haskell.org/ghc/ghc/-/issues/22886#note_481020)
https://github.com/haskell/core-libraries-committee/issues/129
|
|
|
|
|
|
| |
Prefer to use the Ubuntu 20.04 and 18.04 binary distributions on Ubuntu
and Linux Mint. Prefer to use the Rocky 8 binary distribution on
unknown distributions.
|
|
|
|
| |
Add the released testsuite tarball to the generated ghcup metadata.
|
|
|
|
|
|
|
|
|
|
|
| |
We were failing to expand type synonyms in the function
GHC.Core.RoughMap.typeToRoughMatchLookupTc, even though the
RoughMap infrastructure crucially relies on type synonym expansion
to work.
This patch adds the missing type-synonym expansion.
Fixes #22985
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generalCategory contains a huge literal string but is marked INLINE,
this will duplicate the string into any use site of generalCategory. In
particular generalCategory is used in functions like isSpace and the
literal gets inlined into this function which makes it massive.
https://github.com/haskell/core-libraries-committee/issues/130
Fixes #22949
-------------------------
Metric Decrease:
T4029
T18304
-------------------------
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit cfc8e2e2 introduced a mechanism for handling of exceptions
that occur during Handle finalization, and 372cf730 set the default
handler to print out the error to stderr.
However, #21680 pointed out we might not want to set this by default,
as it might pollute users' terminals with unwanted information.
So, for the time being, the default handler discards the exception.
Fixes #21680
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following #22924 this patch narrows the test that stops
us decomposing newtypes. The key change is the use of
noGivenNewtypeReprEqs in GHC.Tc.Solver.Canonical.canTyConApp.
We went to and fro on the solution, as you can see in #22924.
The result is carefully documented in
Note [Decomoposing newtype equalities]
On the way I had revert most of
commit 3e827c3f74ef76d90d79ab6c4e71aa954a1a6b90
Author: Richard Eisenberg <rae@cs.brynmawr.edu>
Date: Mon Dec 5 10:14:02 2022 -0500
Do newtype unwrapping in the canonicaliser and rewriter
See Note [Unwrap newtypes first], which has the details.
It turns out that
(a) 3e827c3f makes GHC behave worse on some recursive newtypes
(see one of the tests on this commit)
(b) the finer-grained test (namely noGivenNewtypeReprEqs) renders
3e827c3f unnecessary
|
|
|
|
| |
Fixes #22883.
|
| |
|
| |
|
| |
|
|
|
|
| |
See #22970.
|
|
|
|
| |
See #21184
|
|
|
|
| |
Fixes #22658
|
|
|
|
|
| |
This is the small part of implementing
https://github.com/ghc-proposals/ghc-proposals/pull/240
|
|
|
|
|
|
|
| |
This patch adds the rts_clearMemory function that does its best to
zero out unused RTS memory for a wasm backend use case. See the
comment above rts_clearMemory() prototype declaration for more
detailed explanation. Closes #22920.
|
|
|
|
| |
See #22343
|
|
|
|
| |
Follow up from #21078
|
|
|
|
|
|
|
|
|
| |
generateCgIPEStub already correctly implements the CmmTick finding
logic for when tables-next-to-code is on/off, but it used the wrong
predicate to decide when to switch between the two. Previously it
switches based on whether the codegen is unregisterised, but there do
exist registerised builds that disable tables-next-to-code! This patch
corrects that problem. Fixes #22896.
|
|
|
|
|
|
|
|
|
|
| |
Fixes #22829
In GHCi, we were creating an import declaration for Prelude but we were
not setting it as an implicit declaration. Therefore, ghci's import of
Prelude triggered -Wmissing-import-lists.
Adds regression test T22829 to testsuite
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Explain foldrMap1, foldlMap1, foldlMap1', and foldrMap1' in greater
detail, the text is mostly adapted from documentation of Foldable.
* Describe foldr1, foldl1, foldl1' and foldr1' in terms of the above
functions instead of redoing the full explanation.
* Small updates to documentation of fold1, foldMap1 and toNonEmpty,
again adapting from Foldable.
* Update the foldMap1 example to lists instead of Sum since this is
recommended for lazy right-associative folds.
Fixes #22847
|
| |
|
|
|
|
|
|
|
|
| |
The MBLOCK_SHIFT macro must be the single source of truth for defining
the mblock size, and changing it should only affect performance, not
correctness. This patch makes it truly possible to reconfigure mblock
size, at least on 32-bit targets, by fixing places which implicitly
relied on the previous MBLOCK_SHIFT constant. Fixes #22901.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit aed1974e completely re-engineered the treatment of loopy
superclass dictionaries in instance declarations. Unfortunately,
it has the potential to break (albeit in a rather minor way) user code.
To alleviate migration concerns, this commit re-introduces the old
behaviour. Any reliance on this old behaviour triggers a warning,
controlled by `-Wloopy-superclass-solve`. The warning text explains
that GHC might produce bottoming evidence, and provides a migration
strategy.
This allows us to provide a graceful migration period, alerting users
when they are relying on this unsound behaviour.
Fixes #22912 #22891 #20666 #22894 #22905
|
|
|
|
|
|
|
|
|
| |
generator.
* Let binders are now always assumed untagged for bytecode.
* Imported referenced are now always assumed to be untagged for bytecode.
Fixes #22840
|
|
|
|
|
|
|
|
|
| |
Previously the AtomicRead and AtomicWrite operations were emitted as
out-of-line calls. However, these tend to be very important for
performance, especially the RELAXED case (which only exists for
ThreadSanitizer checking).
Fixes #22115.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Hint address to NetBSD mmap(2) has a different semantics from that of
Linux. When a hint address is provided, mmap(2) searches for a free
region at or below the hint but *never* above it. This means we can't
reliably search for free regions incrementally on the userland,
especially when ASLR is enabled. Let the kernel do it for us if we don't
care where the mapped address is going to be.
2. NetBSD not only hates to map pages as rwx, but also disallows to switch
pages from rw- to r-x unless the intention is declared when pages are
initially requested. This means we need a new MemoryAccess mode for
pages that are going to be changed to r-x.
|
|
|
|
|
| |
Not only Linux, Darwin, and FreeBSD support rpaths. Determine the usability
of rpaths based on the object format, not on OS.
|
|
|
|
|
|
| |
Here we add a `--skip` flag to `upload_ghc_libs`, making it easier to
limit which packages to upload. This is often necessary when one package
is not uploadable (e.g. see #22740).
|
| |
|
|
|
|
|
| |
This enables clangd to correctly check C files that import Rts.h.
(The added include directory contains ghcautoconf.h et. al.)
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously there was no documentation for how foreign calls interacted
with the profiler. This can be quite confusing for users so getting it
into the user guide is the first step to a potentially better solution.
See the ticket for more insightful discussion.
Fixes #21764
|
|
|
|
|
|
|
| |
I went through the whole of the profiling docs and tried to amend them
to reflect current best practices and tooling. In particular I removed
some old references to tools such as hp2any and replaced them with
references to eventlog2html.
|
|
|
|
|
|
|
|
|
|
| |
instances
This is a minor refactor that makes it easy to add and remove fields from
`ModIface_` and `ModIfaceBackend`.
Also change the formatting to make it clear exactly which fields are
fully forced with `rnf`
|
| |
|
| |
|
|
|
|
| |
Enables support for the `mold` linker by rui314.
|