summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GHC proposal 496 - Nullary record wildcardsGeorgi Lyubenov2023-02-2132-73/+335
| | | | | | | | | | | | | | | | | | | 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
* Bump submodule text to 2.0.2Bodigrim2023-02-211-0/+0
|
* Disallow `tagToEnum#` on `type data` typeswip/T22948Ryan Scott2023-02-208-0/+53
| | | | | 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.
* Treat type data declarations as empty when checking pattern-matching coverageRyan Scott2023-02-205-5/+52
| | | | | | | 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.
* Don't generate datacon wrappers for `type data` declarationsRyan Scott2023-02-207-6/+91
| | | | | | | | | | | | | | | | | | 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.
* fix: Explicitly flush stdout on pluginromes2023-02-203-8/+14
| | | | | | 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.
* Handle top-level Addr# literals in the bytecode compilerAlexis King2023-02-2012-143/+241
| | | | Fixes #22376.
* compiler: fix cost centre profiling breakage in wasm NCG due to incorrect ↵Cheng Shao2023-02-202-9/+1
| | | | | | | | | | | | | | | | | 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.
* Improve GHC.Tc.Gen.App.tcInstFunwip/T22908Simon Peyton Jones2023-02-207-19/+22
| | | | | | | | | | | | | | 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
* Merge libiserv with ghciSylvain Henry2023-02-1721-251/+104
| | | | | | | | | | `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).
* Add INLINABLE pragmas to `generic*` functions in Data.OldListwip/generic-inlinableMatthew Pickering2023-02-172-0/+7
| | | | | | | | | | | | | 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
* ghcup-metadata: Use Ubuntu and Rocky bindistsMatthew Pickering2023-02-162-5/+20
| | | | | | 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.
* ghcup-metadata: Add test artifactMatthew Pickering2023-02-161-0/+3
| | | | Add the released testsuite tarball to the generated ghcup metadata.
* Expand synonyms in RoughMapsheaf2023-02-164-2/+19
| | | | | | | | | | | 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
* unicode: Don't inline bitmap in generalCategoryMatthew Pickering2023-02-163-2/+11
| | | | | | | | | | | | | | | | | 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 -------------------------
* No default finalizer exception handlersheaf2023-02-1611-29/+52
| | | | | | | | | | | | 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
* Documentation: add an example of SPEC usageBodigrim2023-02-162-3/+24
|
* Narrow the dont-decompose-newtype testSimon Peyton Jones2023-02-1611-166/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* base: Note move of GHC.Stack.CCS.whereFrom to GHC.InfoProv in changelogBen Gamari2023-02-161-0/+8
| | | | Fixes #22883.
* Factor JS Rts generation for h$c{_,0,1,2} into h$c{n} and improve name cachingJosh Meredith2023-02-165-121/+107
|
* JS: disable debugging info for heap objectsSylvain Henry2023-02-161-1/+3
|
* Testsuite: mark T13167 as fragile for JS (#22921)Sylvain Henry2023-02-161-1/+2
|
* Mark all T5435 variants as fragileBryan Richter2023-02-161-0/+5
| | | | See #22970.
* tests: Mark T12903 fragile everywhereBryan Richter2023-02-161-7/+3
| | | | See #21184
* docs: add a section for the wasm backendCheng Shao2023-02-162-1/+102
| | | | Fixes #22658
* Add -single-threaded flag to force single threaded rtsOleg Grenrus2023-02-159-3/+41
| | | | | This is the small part of implementing https://github.com/ghc-proposals/ghc-proposals/pull/240
* rts: add the rts_clearMemory functionCheng Shao2023-02-159-4/+118
| | | | | | | 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.
* Allow failure in nightly-x86_64-linux-deb10-no_tntc-validateBryan Richter2023-02-152-2/+8
| | | | See #22343
* docs: release notes, user guide: add js backenddoyougnu2023-02-152-0/+39
| | | | Follow up from #21078
* compiler: fix generateCgIPEStub for no-tables-next-to-code buildsCheng Shao2023-02-141-14/+14
| | | | | | | | | 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.
* fix: Mark ghci Prelude import as implicitromes2023-02-144-5/+11
| | | | | | | | | | 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
* Documentation: Improve Foldable1 documentationmeooow252023-02-141-68/+91
| | | | | | | | | | | | | * 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
* Update outdated references to notesSimon Hengel2023-02-1410-23/+23
|
* rts: make it possible to change mblock size on 32-bit targetsCheng Shao2023-02-143-3/+9
| | | | | | | | 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.
* Introduce warning for loopy superclass solvesheaf2023-02-1426-100/+342
| | | | | | | | | | | | | | | | | 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
* Fix some correctness issues around tag inference when targeting the bytecode ↵Andreas Klebinger2023-02-149-27/+115
| | | | | | | | | generator. * Let binders are now always assumed untagged for bytecode. * Imported referenced are now always assumed to be untagged for bytecode. Fixes #22840
* nativeGen/AArch64: Emit Atomic{Read,Write} inlineBen Gamari2023-02-143-2/+37
| | | | | | | | | 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.
* base: Move changelog entry to its placeLi-yao Xia2023-02-141-4/+4
|
* RTS linker: Improve compatibility with NetBSDPHO2023-02-142-11/+39
| | | | | | | | | | | | | | 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.
* Assume platforms support rpaths if they use either ELF or Mach-OPHO2023-02-141-4/+12
| | | | | Not only Linux, Darwin, and FreeBSD support rpaths. Determine the usability of rpaths based on the object format, not on OS.
* upload_ghc_libs: More control over which packages to operate onBen Gamari2023-02-141-4/+9
| | | | | | 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).
* Mention new `Foreign.Marshal.Pool` implementation in User's Guideamesgen2023-02-141-5/+3
|
* Add clangd flag to include generated header filesSven Tennie2023-02-141-1/+1
| | | | | This enables clangd to correctly check C files that import Rts.h. (The added include directory contains ghcautoconf.h et. al.)
* Document that -fproc-alignment was introduced only in GHC 8.6Bodigrim2023-02-131-0/+2
|
* docs: Add section about profiling and foreign callswip/profiling-docs-refreshMatthew Pickering2023-02-131-0/+36
| | | | | | | | | 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
* Refresh profiling docsMatthew Pickering2023-02-132-150/+57
| | | | | | | 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.
* compiler: Use NamedFieldPuns for `ModIface_` and `ModIfaceBackend` `NFData`Zubin Duggal2023-02-101-11/+50
| | | | | | | | | | 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`
* Testsuite: decrease length001 timeout for JS (#22921)Sylvain Henry2023-02-102-3/+8
|
* Add Lift instance for Fixedparsonsmatt2023-02-102-0/+11
|
* Detect the `mold` linkerRebecca Turner2023-02-102-0/+6
| | | | Enables support for the `mold` linker by rui314.