summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Transfer DFunId_ness onto specialised bindingswip/t22549Simon Peyton Jones2023-04-141-41/+78
| | | | | | | | | | | | | | | | | | | | Whether a binding is a DFunId or not has consequences for the `-fdicts-strict` flag, essentially if we are doing demand analysis for a DFunId then `-fdicts-strict` does not apply because the constraint solver can create recursive groups of dictionaries. In #22549 this was fixed for the "normal" case, see Note [Do not strictify the argument dictionaries of a dfun]. However the loop still existed if the DFunId was being specialised. The problem was that the specialiser would specialise a DFunId and turn it into a VanillaId and so the demand analyser didn't know to apply special treatment to the binding anymore and the whole recursive group was optimised to bottom. The solution is to transfer over the DFunId-ness of the binding in the specialiser so that the demand analyser knows not to apply the `-fstrict-dicts`. Fixes #22549
* Stop if type constructors have kind errorsSimon Peyton Jones2023-04-146-17/+35
| | | | | | | | | Otherwise we get knock-on errors, such as #23252. This makes GHC fail a bit sooner, and I have not attempted to add recovery code, to add a fake TyCon place of the erroneous one, in an attempt to get more type errors in one pass. We could do that (perhaps) if there was a call for it.
* docs: Generate docs/index.html with version numberMatthew Pickering2023-04-143-4/+5
| | | | | | | | | | * Generate docs/index.html to include the version of the ghc library * This also fixes the packageVersions interpolations which were - Missing an interpolation for `LIBRARY_ghc_VERSION` - Double quoting the version so that "9.7" was being inserted. Fixes #23121
* rts: improve memory ordering and add some comments in the StablePtr ↵Adam Sandberg Ericsson2023-04-141-10/+36
| | | | implementation
* Base/JS: GHC.JS.Foreign.Callback module (issue 23126)Josh Meredith2023-04-1328-4/+638
| | | | | | | | | | | | | * Add the Callback module for "exporting" Haskell functions to be available to plain JavaScript code * Fix some primitives defined in GHC.JS.Prim * Add a JavaScript section to the user guide with instructions on how to use the JavaScript FFI, building up to using Callbacks to interact with the browser * Add tests for the JavaScript FFI and Callbacks
* Make WordQuotRem2Op ok-for-speculation tooSylvain Henry2023-04-132-3/+6
|
* Make Int64/Word64 division ok for speculation too.Sylvain Henry2023-04-132-13/+10
| | | | Only when the divisor is definitely non-zero.
* Add quot folding rule (#22152)Sylvain Henry2023-04-136-19/+177
| | | | | | | (x / l1) / l2 l1 and l2 /= 0 l1*l2 doesn't overflow ==> x / (l1 * l2)
* Add quotRem rules (#22152)Sylvain Henry2023-04-135-0/+92
| | | | | | | | | | | | | | case quotRemInt# x y of (# q, _ #) -> body ====> case quotInt# x y of q -> body case quotRemInt# x y of (# _, r #) -> body ====> case remInt# x y of r -> body
* Add regression test for #23229Rodrigo Mesquita2023-04-123-0/+3
|
* Allow generation of TTH syntax with THOleg Grenrus2023-04-1217-1/+88
| | | | | | | | | | | | | | | | | | | | In other words allow generation of typed splices and brackets with Untyped Template Haskell. That is useful in cases where a library is build with TTH in mind, but we still want to generate some auxiliary declarations, where TTH cannot help us, but untyped TH can. Such example is e.g. `staged-sop` which works with TTH, but we would like to derive `Generic` declarations with TH. An alternative approach is to use `unsafeCodeCoerce`, but then the derived `Generic` instances would be type-checked only at use sites, i.e. much later. Also `-ddump-splices` output is quite ugly: user-written instances would use TTH brackets, not `unsafeCodeCoerce`. This commit doesn't allow generating of untyped template splices and brackets with untyped TH, as I don't know why one would want to do that (instead of merging the splices, e.g.)
* Clarify a couple of Notes about 'nospec'Simon Peyton Jones2023-04-112-5/+12
|
* Set base 'maintainer' field to CLCBodigrim2023-04-111-2/+2
|
* compiler: apply cmm node-splitting for wasm backendCheng Shao2023-04-112-3/+10
| | | | | This patch applies cmm node-splitting for wasm32 NCG, which is required when handling irreducible CFGs. Fixes #23237.
* compiler: make WasmCodeGenM an instance of MonadUniqueCheng Shao2023-04-112-6/+14
|
* Add missing cases in -Di prettyprinterKrzysztof Gogolewski2023-04-115-0/+86
| | | | Fixes #23142
* Add support for -debug in the testsuiteKrzysztof Gogolewski2023-04-116-5/+21
| | | | Confusingly, GhcDebugged referred to GhcDebugAssertions.
* Renamer: don't call addUsedGRE on an exact Namesheaf2023-04-076-16/+41
| | | | | | | | | | When looking up a record field in GHC.Rename.Env.lookupRecFieldOcc, we could end up calling addUsedGRE on an exact Name, which would then lead to a panic in the bestImport function: it would be incapable of processing a GRE which is not local but also not brought into scope by any imports (as it is referred to by its unique instead). Fixes #23240
* Add structured error messages for GHC.Tc.TyCl.UtilsTorsten Schmits2023-04-077-18/+42
| | | | | | | | | Tracking ticket: #20117 MR: !10251 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Adjust wording wrt representation polymorphism of ($)Sebastian Graf2023-04-071-1/+1
|
* Remove trailing whitespace from ($) commentaryAlex Dixon2023-04-071-3/+3
|
* Improve documentation for ($) (#22963)Alex Dixon2023-04-071-12/+63
|
* Add release note for GHC.Unicode refactor in base-4.18.Pierre Le Marre2023-04-061-3/+4
| | | | | Also merge CLC proposal 130 in base-4.19 with CLC proposal 59 in base-4.18 and add proper release date.
* Fix reverse flag for -Wunsupported-llvm-versionBrandon Chinn2023-04-061-1/+1
|
* nonmoving: Disable slop-zeroingBen Gamari2023-04-061-4/+8
| | | | | | | | | As noted in #23170, the nonmoving GC can race with a mutator zeroing the slop of an updated thunk (in much the same way that two mutators would race). Consequently, we must disable slop-zeroing when the nonmoving GC is in use. Closes #23170
* Add testcase for #23192sheaf2023-04-042-0/+17
| | | | | | | | | | This issue around solving of constraints arising from superclass expansion using other constraints also borned from superclass expansion was the topic of commit aed1974e. That commit made sure we don't emit a "redundant constraint" warning in a situation in which removing the constraint would cause errors. Fixes #23192
* Fix unification with oversaturated type familiesKrzysztof Gogolewski2023-04-044-30/+154
| | | | | | unify_ty was incorrectly saying that F x y ~ T x are surely apart, where F x y is an oversaturated type family and T x is a tyconapp. As a result, the simplifier dropped a live case alternative (#23134).
* Make INLINE pragmas for pattern synonyms work with THRyan Scott2023-04-044-1/+63
| | | | | | | | | | Previously, the code for converting `INLINE <name>` pragmas from TH splices used `vNameN`, which assumed that `<name>` must live in the variable namespace. Pattern synonyms, on the other hand, live in the constructor namespace. I've fixed the issue by switching to `vcNameN` instead, which works for both the variable and constructor namespaces. Fixes #23203.
* GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201)Sylvain Henry2023-04-042-26/+45
|
* Relax assertion in varToRecFieldOccsheaf2023-04-045-4/+54
| | | | | | | | | | | | When using Template Haskell, it is possible to re-parent a field OccName belonging to one data constructor to another data constructor. The lsp-types package did this in order to "extend" a data constructor with additional fields. This ran into an assertion in 'varToRecFieldOcc'. This assertion can simply be relaxed, as the resulting splices are perfectly sound. Fixes #23220
* StgToCmm: Upgrade -fcheck-prim-bounds behaviorMatthew Craven2023-04-0415-111/+573
| | | | | Fixes #21054. Additionally, we can now check for range overlap when generating Cmm for primops that use memcpy internally.
* Add a few more memcpy-ish primopsMatthew Craven2023-04-046-40/+155
| | | | | | | | | | | | | | | | * copyMutableByteArrayNonOverlapping# * copyAddrToAddr# * copyAddrToAddrNonOverlapping# * setAddrRange# The implementations of copyBytes, moveBytes, and fillBytes in base:Foreign.Marshal.Utils now use these new primops, which can cause us to work a bit harder generating code for them, resulting in the metric increase in T21839c observed by CI on some architectures. But in exchange, we get better code! Metric Increase: T21839c
* Fixes around unsafeCoerce#Krzysztof Gogolewski2023-04-035-69/+59
| | | | | | | | | | | | 1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul in 74ad75e87317, `unsafeCoerce#` is no longer defined there. I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module. 2. The documentation of `unsafeCoerce#` stated that you should not cast a function to an algebraic type, even if you later cast it back before applying it. But ghci was doing that type of cast, as can be seen with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any following the documentation.
* Convert diagnostics in GHC.Rename.HsType to proper TcRnMessageHaskell-mouse2023-04-0331-132/+395
| | | | | | | | | | | | | | | | | | I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType module into a proper TcRnMessage. Instead, these TcRnMessage messages were introduced: TcRnDataKindsError TcRnUnusedQuantifiedTypeVar TcRnIllegalKindSignature TcRnUnexpectedPatSigType TcRnSectionPrecedenceError TcRnPrecedenceParsingError TcRnIllegalKind TcRnNegativeNumTypeLiteral TcRnUnexpectedKindVar TcRnBindMultipleVariables TcRnBindVarAlreadyInScope
* JS: fix issues with FD api supportSylvain Henry2023-04-032-2/+11
| | | | | | | | - Add missing implementations for fcntl_read/write/lock - Fix fdGetMode These were found while implementing TH in !9779. These functions must be used somehow by the external interpreter code.
* hadrian: Improve option parsingKrzysztof Gogolewski2023-04-031-76/+56
| | | | | | | | Several options in Hadrian had their argument marked as optional (`OptArg`), but if the argument wasn't there they were just giving an error. It's more idiomatic to mark the argument as required instead; the code uses less Maybes, the parser can enforce that the argument is present, --help gives better output.
* ci: Add job to test 9.6 bootstrappingMatthew Pickering2023-04-031-1/+3
|
* hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1Matthew Pickering2023-04-0326-140/+1257
| | | | | | | | Also fixes the ./generate_bootstrap_plans script which was recently broken We can hopefully drop the 9.2 plans soon but they still work so kept them around for now.
* ghc-heap: remove wrong Addr# coercion (#23181)Sylvain Henry2023-04-033-4/+5
| | | | Conversion from Addr# to I# isn't correct with the JS backend.
* cmm: implement parsing of MO_AtomicRMW from hand-written CMM filesBodigrim2023-04-025-0/+153
| | | | Fixes #23206
* Rework documentation for data CharBodigrim2023-04-021-11/+90
|
* TH: revert changes to GadtC & RecGadtCsheaf2023-04-0115-66/+79
| | | | | | | Commit 3f374399 included a breaking-change to the template-haskell library when it made the GadtC and RecGadtC constructors take non-empty lists of names. As this has the potential to break many users' packages, we decided to revert these changes for now.
* Improve haddocks of template-haskell Con datatypesheaf2023-04-011-11/+27
| | | | | This adds a bit more information, in particular about the lists of constructors in the GadtC and RecGadtC cases.
* JS: Linker: use saturated JExprdoyougnu2023-04-012-100/+5
| | | | Follow on to MR!10142 in pursuit of #22736
* Add structured error messages for GHC.Tc.TyClTorsten Schmits2023-04-0197-440/+1028
| | | | | | | | | Tracking ticket: #20117 MR: !10183 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* driver: Unit State Data.Map -> GHC.Unique.UniqMapdoyougnu2023-04-0113-159/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In pursuit of #22426. The driver and unit state are major contributors. This commit also bumps the haddock submodule to reflect the API changes in UniqMap. ------------------------- Metric Decrease: MultiComponentModules MultiComponentModulesRecomp T10421 T10547 T12150 T12234 T12425 T13035 T16875 T18140 T18304 T18698a T18698b T18923 T20049 T5837 T6048 T9198 -------------------------
* User Guide: update copyright year: 2020->2023Artem Pelenitsyn2023-04-011-1/+1
|
* [feat] make ($) representation polymorphicmangoiv2023-04-0115-27/+47
| | | | | | | | | | | | | | - this change was approved by the CLC in [1] following a CLC proposal [2] - make ($) representation polymorphic (adjust the type signature) - change ($) implementation to allow additional polymorphism - adjust the haddock of ($) to reflect these changes - add additional documentation to document these changes - add changelog entry - adjust tests (move now succeeding tests and adjust stdout of some tests) [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854 [2] https://github.com/haskell/core-libraries-committee/issues/132
* Add test for T23184Matthew Pickering2023-03-313-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch: ``` commit 6656f0165a30fc2a22208532ba384fc8e2f11b46 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Jul 23 23:57:01 2021 +0100 A bunch of changes related to eta reduction This is a large collection of changes all relating to eta reduction, originally triggered by #18993, but there followed a long saga. Specifics: ...lots of lines omitted... Other incidental changes * Fix a fairly long-standing outright bug in the ApplyToVal case of GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the tail of 'dmds' in the recursive call, which meant the demands were All Wrong. I have no idea why this has not caused problems before now. ``` Note this "Fix a fairly longstanding outright bug". This is the specific fix ``` @@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds -- let a = ...arg... -- in [...hole...] a -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable - do { let (dmd:_) = dmds -- Never fails - ; (floats1, cont') <- mkDupableContWithDmds env dmds cont + do { let (dmd:cont_dmds) = dmds -- Never fails + ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont ; let env' = env `setInScopeFromF` floats1 ; (_, se', arg') <- simplArg env' dup se arg ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg' ``` Ticket #23184 is a report of the bug that this diff fixes.
* testsuite: asyncify the testsuite driverCheng Shao2023-03-303-133/+140
| | | | | | | | | | | | | | This patch refactors the testsuite driver, gets rid of multi-threading logic for running test cases concurrently, and uses asyncio & coroutines instead. This is not yak shaving for its own sake; the previous multi-threading logic is prone to livelock/deadlock conditions for some reason, even if the total number of threads is bounded to a thread pool's capacity. The asyncify change is an internal implementation detail of the testsuite driver and does not impact most GHC maintainers out there. The patch does not touch the .T files, test cases can be added/modified the exact same way as before.