summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hadrian: Improve option parsingwip/hadrian-optsKrzysztof Gogolewski2023-03-301-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.
* Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNatRyan Scott2023-03-286-0/+30
| | | | | This implements [CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
* Make exprIsConApp_maybe a bit clevererwip/T23159Simon Peyton Jones2023-03-271-8/+54
| | | | | | | | | | | | | | | | | | | | | | | Addresses #23159. See Note Note [Exploit occ-info in exprIsConApp_maybe] in GHC.Core.SimpleOpt. Compile times go down very slightly, but always go down, never up. Good! Metrics: compile_time/bytes allocated ------------------------------------------------ CoOpt_Singletons(normal) -1.8% T15703(normal) -1.2% GOOD geo. mean -0.1% minimum -1.8% maximum +0.0% Metric Decrease: CoOpt_Singletons T15703
* Document the constructor name for listsDavid Feuer2023-03-261-1/+4
| | | | | | | | | Derived `Data` instances use raw infix constructor names when applicable. The `Data.Data [a]` instance, if derived, would have a constructor name of `":"`. However, it actually uses constructor name `"(:)"`. Document this peculiarity. See https://github.com/haskell/core-libraries-committee/issues/147
* Update and expand atomic modification HaddocksDavid Feuer2023-03-262-14/+67
| | | | | | | | | | * The documentation for `atomicModifyIORef` and `atomicModifyIORef'` were incomplete, and the documentation for `atomicModifyIORef` was out of date. Update and expand. * Remove a useless lazy pattern match in the definition of `atomicModifyIORef`. The pair it claims to match lazily was already forced by `atomicModifyIORef2`.
* Add Eq/Ord instances for SSymbol, SChar, and SNatRyan Scott2023-03-253-1/+27
| | | | This implements [CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148).
* rts: Fix capability-count check in zeroSlopBen Gamari2023-03-251-3/+2
| | | | | | | | | Previously `zeroSlop` examined `RtsFlags` to determine whether the program was single-threaded. This is wrong; a program may be started with `+RTS -N1` yet the process may later increase the capability count with `setNumCapabilities`. This lead to quite subtle and rare crashes. Fixes #23088.
* rts: Don't rely on EXTERN_INLINE for slop-zeroing logicBen Gamari2023-03-254-23/+47
| | | | | | | | | | | | | Previously we relied on calling EXTERN_INLINE functions defined in ClosureMacros.h from Cmm to zero slop. However, as far as I can tell, this is no longer safe to do in C99 as EXTERN_INLINE definitions may be emitted in each compilation unit. Fix this by explicitly declaring a new set of non-inline functions in ZeroSlop.c which can be called from Cmm and marking the ClosureMacros.h definitions as INLINE_HEADER. In the future we should try to eliminate EXTERN_INLINE.
* Improve documentation for resizing of byte arraysBodigrim2023-03-251-11/+35
|
* testsuite: add the rts_clearMemory test caseCheng Shao2023-03-255-0/+43
| | | | | | This patch adds a standalone test case for rts_clearMemory that mimics how it's typically used by wasm backend users and ensures this RTS API isn't broken by future RTS refactorings. Fixes #23901.
* rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023Cheng Shao2023-03-254-5/+4
| | | | | | | | | | | This patch does a few things: - Add the missing RtsSymbols.c entry of performBlockingMajorGC - Make hs_perform_gc call performBlockingMajorGC, which restores previous behavior - Use hs_perform_gc in ffi023 - Remove rts_clearMemory() call in ffi023, it now works again in some test ways previously marked as broken. Fixes #23089
* Improve documentation of atomicModifyMutVar2#Bodigrim2023-03-251-5/+17
|
* rts: Fix barriers of IND and IND_STATICBen Gamari2023-03-252-9/+11
| | | | | | | | | Previously IND and IND_STATIC lacked the acquire barriers enjoyed by BLACKHOLE. As noted in the (now updated) Note [Heap memory barriers], this barrier is critical to ensure that the indirectee is visible to the entering core. Fixes #22872.
* Modify ThreadId documentation and commentsDavid Feuer2023-03-251-7/+3
| | | | | | | | | | | | | | | | | | | | | | For a long time, `GHC.Conc.Sync` has said ```haskell -- ToDo: data ThreadId = ThreadId (Weak ThreadId#) -- But since ThreadId# is unlifted, the Weak type must use open -- type variables. ``` We are now actually capable of using `Weak# ThreadId#`, but the world has moved on. To support the `Show` and `Ord` instances, we'd need to store the thread ID number in the `ThreadId`. And it seems very difficult to continue to support `threadStatus` in that regime, since it needs to be able to explain how threads died. In addition, garbage collection of weak references can be quite expensive, and it would be hard to evaluate the cost over he whole ecosystem. As discussed in [this CLC issue](https://github.com/haskell/core-libraries-committee/issues/125), it doesn't seem very likely that we'll actually switch to weak references here.
* fix: account for large and compact object stats with nonmoving gcTeo Camarasu2023-03-255-7/+36
| | | | | | | Make sure that we keep track of the size of large and compact objects that have been moved onto the nonmoving heap. We keep track of their size and add it to the amount of live bytes in nonmoving segments to get the total size of the live nonmoving heap. Resolves #17574
* Add regression test for #17574Teo Camarasu2023-03-253-0/+44
| | | | This test currently fails in the nonmoving way
* base: Document GHC versions associated with past base versions in the changelogLi-yao Xia2023-03-251-1/+8
|
* codeGen/tsan: Disable instrumentation of unaligned storesBen Gamari2023-03-241-8/+7
| | | | | | | | | | There is some disagreement regarding the prototype of `__tsan_unaligned_write` (specifically whether it takes just the written address, or the address and the value as an argument). Moreover, I have observed crashes which appear to be due to it. Disable instrumentation of unaligned stores as a temporary mitigation. Fixes #23096.
* User's guide: Improve docs for -WallJoachim Breitner2023-03-241-22/+14
| | | | | | previously it would list the warnings _not_ enabled by -Wall. That’s unnecessary round-about and was out of date. So let's just name the relevant warnings (based on `compiler/GHC/Driver/Flags.hs`).
* nativeGen/AArch64: Fix bitmask immediate predicateBen Gamari2023-03-241-15/+35
| | | | | | | | | Previously the predicate for determining whether a logical instruction operand could be encoded as a bitmask immediate was far too conservative. This meant that, e.g., pointer untagged required five instructions whereas it should only require one. Fixes #23030.
* Move mention of warning groups change to 9.8.1 release notesAdam Gundry2023-03-242-5/+5
|
* Allow WARNING pragmas to be controlled with custom categoriesAdam Gundry2023-03-2439-94/+649
| | | | | | | | | | | | | | | | Closes #17209. This implements GHC Proposal 541, allowing a WARNING pragma to be annotated with a category like so: {-# WARNING in "x-partial" head "This function is undefined on empty lists." #-} The user can then enable, disable and set the severity of such warnings using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There is a new warning group `-Wextended-warnings` containing all these warnings. Warnings without a category are treated as if the category was `deprecations`, and are (still) controlled by the flags `-Wdeprecations` and `-Wwarnings-deprecations`. Updates Haddock submodule.
* Add structured error messages for GHC.Tc.TyCl.PatSynTorsten Schmits2023-03-2314-60/+175
| | | | | | | | | Tracking ticket: #20117 MR: !10158 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Update changelog to mention changes to instance Foldable (Compose f g)Bodigrim2023-03-231-0/+2
|
* Simplify minimum/maximum in instance Foldable (Compose f g)Bodigrim2023-03-231-6/+2
|
* Additional optimized versionsArmando Ramirez2023-03-231-3/+18
|
* Optimized Foldable methods for Data.Functor.ComposeArmando Ramirez2023-03-231-0/+7
| | | | | | Explicitly define length, elem, etc. in Foldable instance for Data.Functor.Compose Implementation of https://github.com/haskell/core-libraries-committee/issues/57
* Testsuite: use js_skip for T2615 (#22374)Sylvain Henry2023-03-221-1/+3
|
* Add structured error messages for GHC.Tc.Utils.TcMTypeTorsten Schmits2023-03-2226-82/+152
| | | | | | | | | Tracking ticket: #20119 MR: !10138 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Refactor the constraint solver pipelinewip/T23070Simon Peyton Jones2023-03-2214-4162/+4302
| | | | | | | | | | | | | | | | The big change is to put the entire type-equality solver into GHC.Tc.Solver.Equality, rather than scattering it over Canonical and Interact. Other changes * EqCt becomes its own data type, a bit like QCInst. This is great because EqualCtList is then just [EqCt] * New module GHC.Tc.Solver.Dict has come of the class-contraint solver. In due course it will be all. One step at a time. This MR is intended to have zero change in behaviour: it is a pure refactor. It opens the way to subsequent tidying up, we believe.
* Testsuite: use req_interp predicate for T20214Sylvain Henry2023-03-221-1/+1
|
* Testsuite: use req_interp predicate for T16318 (#22370)Sylvain Henry2023-03-221-1/+1
|
* fix: Incorrect @since annotations in GHC.TypeErrorromes2023-03-222-5/+5
| | | | Fixes #23128
* Testsuite: use appropriate predicate for ManyUbxSums test (#22576)Sylvain Henry2023-03-221-1/+1
|
* Be more careful about quantificationSimon Peyton Jones2023-03-2227-195/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR is driven by #23051. It does several things: * It is guided by the generalisation plan described in #20686. But it is still far from a complete implementation of that plan. * Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind. This explains that we don't (yet, pending #20686) directly prevent generalising over escaping kinds. * In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep and Multiplicity variables, beause we don't want to quantify over them. We want to do the same for a Concrete tyvar, but there is nothing sensible to default it to (unless it has kind RuntimeRep, in which case it'll be caught by an earlier case). So we promote instead. * Pure refactoring in GHC.Tc.Solver: * Rename decideMonoTyVars to decidePromotedTyVars, since that's what it does. * Move the actual promotion of the tyvars-to-promote from `defaultTyVarsAndSimplify` to `decidePromotedTyVars`. This is a no-op; just tidies up the code. E.g then we don't need to return the promoted tyvars from `decidePromotedTyVars`. * A little refactoring in `defaultTyVarsAndSimplify`, but no change in behaviour. * When making a TauTv unification variable into a ConcreteTv (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name of the type variable. This just improves error messages. * Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
* Compute LambdaFormInfo when using JavaScript backend.Luite Stegeman2023-03-215-8/+21
| | | | | | | | | | | CmmCgInfos is needed to write interface files, but the JavaScript backend does not generate it, causing "Name without LFInfo" warnings. This patch adds a conservative but always correct CmmCgInfos when the JavaScript backend is used. Fixes #23053
* Allow LLVM backend to use HDoc for faster file generation.Alex Mason2023-03-218-348/+524
| | | | | | Also remove the MetaStmt constructor from LlvmStatement and places the annotations into the Store statement. Includes “Implement a workaround for -no-asm-shortcutting bug“ (https://gitlab.haskell.org/ghc/ghc/-/commit/2fda9e0df886cc551e2cd6b9c2a384192bdc3045)
* Document pdep / pext primopsBodigrim2023-03-211-10/+59
|
* Add structured error messages for GHC.Tc.Utils.EnvTorsten Schmits2023-03-2129-115/+270
| | | | | | | | | Tracking ticket: #20119 MR: !10129 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* docs: add WALL_CLOCK_TIME event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+12
|
* docs: add TASK_DELETE event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+9
|
* docs: add BlockedOnMVarRead thread status in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+1
|
* docs: explain the BLOCK_MARKER eventAdam Sandberg Ericsson2023-03-211-3/+4
|
* docs: fix some wrongs in the eventlog format documentationAdam Sandberg Ericsson2023-03-211-4/+7
|
* Rename () into Unit, (,,...,,) into Tuple<n> (#21294)Andrei Borzenkov2023-03-2126-157/+295
| | | | | | | | | | | | | | | | | | | | | This patch implements a part of GHC Proposal #475. The key change is in GHC.Tuple.Prim: - data () = () - data (a,b) = (a,b) - data (a,b,c) = (a,b,c) ... + data Unit = () + data Tuple2 a b = (a,b) + data Tuple3 a b c = (a,b,c) ... And the rest of the patch makes sure that Unit and Tuple<n> are pretty-printed as () and (,,...,,) in various contexts. Updates the haddock submodule. Co-authored-by: Vladislav Zavialov <vlad.z.4096@gmail.com>
* Add structured error messages for GHC.Tc.Utils.BackpackTorsten Schmits2023-03-1715-49/+121
| | | | | | | | | | | | Tracking ticket: #20119 MR: !10127 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`. One occurrence, when handing a nested error from the interface loading machinery, was omitted. It will be handled by a subsequent changeset that addresses interface errors.
* ghci: only keep the GlobalRdrEnv in ModInfosheaf2023-03-164-16/+49
| | | | | | | | | The datatype GHC.UI.Info.ModInfo used to store a ModuleInfo, which includes a TypeEnv. This can easily cause space leaks as we have no way of forcing everything in a type environment. In GHC, we only use the GlobalRdrEnv, which we can force completely. So we only store that instead of a fully-fledged ModuleInfo.
* configure: Fix FIND_CXX_STD_LIB test on DarwinBen Gamari2023-03-161-0/+11
| | | | | | | | Annoyingly, Darwin's <cstddef> includes <version> and APFS is case-insensitive. Consequently, it will end up #including the `VERSION` file generated by the `configure` script on the second and subsequent runs of the `configure` script. See #23116.
* Add changelog entry for #23049Teo Camarasu2023-03-161-0/+3
|
* Fix BCO creation setting caps when -j > -NTeo Camarasu2023-03-163-49/+13
| | | | | | | | | | | | | | * Remove calls to 'setNumCapabilities' in 'createBCOs' These calls exist to ensure that 'createBCOs' can benefit from parallelism. But this is not the right place to call `setNumCapabilities`. Furthermore the logic differs from that in the driver causing the capability count to be raised and lowered at each TH call if -j > -N. * Remove 'BCOOpts' No longer needed as it was only used to thread the job count down to `createBCOs` Resolves #23049