summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Check for libatomic dependency for atomic operationswip/T19119Ben Gamari2021-02-092-0/+26
| | | | | | | Some platforms (e.g. RISC-V) require linking against libatomic for some (e.g. sub-word-sized) atomic operations. Fixes #19119.
* Fix a long standing bug in constraint solvingSimon Peyton Jones2021-02-095-20/+121
| | | | | | | | | | | | | | | | When combining Inert: [W] C ty1 ty2 Work item: [D] C ty1 ty2 we were simply discarding the Derived one. Not good! We should turn the inert back into [WD] or keep both. E.g. fundeps work only on Derived (see isImprovable). This little patch fixes it. The bug is hard to tickle, but #19315 did so. The fix is a little messy (see Note [KeepBoth] plus the change in addDictCt), but I am disinclined to refine it further because it'll all be swept away when we Kill Deriveds.
* Fix pretty-printing of invisible arguments for FUN 'Many (#19310)Krzysztof Gogolewski2021-02-094-2/+12
|
* Reduce inlining in deeply-nested casesSimon Peyton Jones2021-02-0915-45/+399
| | | | | | | | | | | | This adds a new heuristic, controllable via two new flags to better tune inlining behaviour. The new flags are -funfolding-case-threshold and -funfolding-case-scaling which are document both in the user guide and in Note [Avoid inlining into deeply nested cases]. Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
* Bump Haddock submodulewip/bump-haddockBen Gamari2021-02-061-0/+0
| | | | Merged ghc-8.10 into ghc-head.
* Fix typosBrian Wignall2021-02-0685-113/+113
|
* base: Fix since-annotation for Data.List.singletonSimon Jakobi2021-02-061-1/+1
|
* Add a test for #18736Krzysztof Gogolewski2021-02-062-0/+8
| | | | | | | Commit 65721691ce9c (Improve inference with linear types, !4632) fixed the bug. Closes #18736.
* Make pattern synonyms play with CallStackSimon Peyton Jones2021-02-064-2/+63
| | | | | | | | This small patch makes pattern synonyms play nicely with CallStack constraints, using logic explained in GHC.Tc.Gen.Pat Note [Call-stack tracing of pattern synonyms] Fixes #19289
* Make unsafeDupablePerformIO have a lazy demandAndreas Klebinger2021-02-062-35/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | When a user writes code like: unsafePerformIO $ do let x = f x writeIORef ref x return x We might expect that the write happens before we evaluate `f x`. Sadly this wasn't to case for reasons detailed in #19181. We fix this by avoiding the strict demand by turning: unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> a into unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> lazy a This makes the above code lazy in x. And ensures the side effect of the write happens before the evaluation of `f x`. If a user *wants* the code to be strict on the returned value he can simply use `return $! x`. This fixes #19181
* Fix buglet in expandSynTyCon_maybeSimon Peyton Jones2021-02-064-5/+13
| | | | | | | | | | The fix for #17958, implemented in MR !2952, introduced a small bug in GHC.Core.TyCon.expandSynTyCon_maybe, in the case of under-saturated type synonyms. This MR fixes the bug, very easy. Fixes #19279
* The Char kind (#11342)Daniel Rogozin2021-02-0649-131/+666
| | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io> Implement GHC Proposal #387 * Parse char literals 'x' at the type level * New built-in type families CmpChar, ConsSymbol, UnconsSymbol * New KnownChar class (cf. KnownSymbol and KnownNat) * New SomeChar type (cf. SomeSymbol and SomeNat) * CharTyLit support in template-haskell Updated submodules: binary, haddock. Metric Decrease: T5205 haddock.base Metric Increase: Naperian T13035
* Fix typo in qualified_do.rstBasile Henry2021-02-051-1/+1
|
* validate: Enable tarball autodownload by default.Andreas Klebinger2021-02-051-1/+1
| | | | Fixes #19307
* rts: Fix arguments for foreign calls of interpreterStefan Schulze Frielinghaus2021-02-051-2/+24
| | | | | | | | | | | Function arguments passed to the interpreter are extended to whole words. However, foreign function interface expects correctly typed argument pointers. Accordingly, we have to adjust argument pointers in case of a big-endian architecture. In contrast to function arguments where subwords are passed in the low bytes of a word, the return value is expected to reside in the high bytes of a word.
* Mark both parameters of SimplM one-shot (#19302)Sebastian Graf2021-02-051-2/+7
| | | | | | | Just marking the `SimplTopEnv` parameter as one-shot was not enough to eta-expand `simplExpr`. Fixes #19302.
* FFI: Revisit fix pass small ints in foreign call wrappersStefan Schulze Frielinghaus2021-02-051-26/+5
| | | | | | | Since commit be5d74ca small ints/words are passed according to their natural size which obsoletes fix from commit 01f7052cc1. Reverted 01f7052cc1 but kept the introduced test case.
* IntVar: fix allocation sizeSylvain Henry2021-02-052-3/+6
| | | | | | As found by @phadej in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4740/diffs#note_327510 Also fix FastMutInt which allocating the size in bits instead of bytes.
* rts: Use properly sized pointers in e.g. rts_mkInt8Stefan Schulze Frielinghaus2021-02-051-26/+20
| | | | | | | Since commit be5d74caab the payload of a closure of Int<N> or Word<N> is not extended anymore to the machines word size. Instead, only the first N bits of a payload are written. This patch ensures that only those bits are read/written independent of the machines endianness.
* Try eta expanding FCode (See #18202)Andreas Klebinger2021-02-052-2/+33
| | | | | | | | | Also updates the note with the case of multi-argument lambdas. Seems slightly beneficial based on the Cabal test: -O0: -1MB allocations (out of 50GB) -O : -1MB allocations (out of ~200GB)
* Hadrian: Add support for packages with C++ filesMatthew Pickering2021-02-059-4/+43
|
* UnVarGraph: Use foldl' rather than foldr in unionUnVarSetsBen Gamari2021-02-051-1/+1
| | | | | This is avoids pushing the entire list to the stack before we can begin computing the result.
* CallArity: Various comment fixesBen Gamari2021-02-051-10/+10
|
* Remove misleading 'lazy' pattern matches from 'head' and 'tail' in ↵wygulmage2021-02-051-2/+2
| | | | Data.List.NonEmpty
* Add missing instances to ghc-heap typesMatthew Pickering2021-02-022-8/+8
| | | | | | These instances are useful so that a `GenClosure` form `ghc-heap` can be used as a key in a `Map`. Therefore the order itself is not important but just the fact that there is one.
* typecheck: Eliminate allocations in tc_eq_typeBen Gamari2021-02-021-13/+36
| | | | | | | | | | Previously tc_eq_type would allocate a number of closures due to the two boolean "mode" flags, despite the fact that these were always statically known. To avoid this we force tc_eq_type to inline into its call sites, allowing the simplifier to eliminate both some runtime branches and the closure allocations.
* Introduce the DecoratedSDoc typeAlfredo Di Napoli2021-02-0118-111/+125
| | | | | This commit introduces a DecoratedSDoc type which replaces the old ErrDoc, and hopefully better reflects the intent.
* Rename ErrMsg into MsgEnvelopeAlfredo Di Napoli2021-02-0119-129/+143
| | | | Updates Haddock submodule
* Remove ErrDoc and MsgDocAlfredo Di Napoli2021-02-0137-297/+272
| | | | | | | | | | | | | This commit boldly removes the ErrDoc and the MsgDoc from the codebase. The former was introduced with the only purpose of classifying errors according to their importance, but a similar result can be obtained just by having a simple [SDoc], and placing bullets after each of them. On top of that I have taken the perhaps controversial decision to also banish MsgDoc, as it was merely a type alias over an SDoc and as such it wasn't offering any extra type safety. Granted, it was perhaps making type signatures slightly more "focused", but at the expense of cognitive burden: if it's really just an SDoc, let's call it with its proper name.
* Add driver/ghci/ghci-wrapper.cabal to .gitignoreRyan Scott2021-02-012-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | After commit 55ef3bdc28681a22ceccf207707c49229f9b7559, running `./configure` now generates a `driver/ghci/ghci-wrapper.cabal` file from `driver/ghci/ghci-wrapper.cabal.in`, which pollutes the `git` tree: ``` $ git status On branch master Your branch is up to date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) driver/ghci/ghci-wrapper.cabal nothing added to commit but untracked files present (use "git add" to track) ``` Since `driver/ghci/ghci-wrapper.cabal` is autogenerated, the sensible thing to do is to add it to `.gitignore`. While I was in town, I also added the standard `*.in` file disclaimer to `driver/ghci/ghci-wrapper.cabal.in`. [ci skip]
* Fix accidental unsoundness in Data.Typeable.Internal.mkTypeLitFromStringRyan Scott2021-02-014-1/+36
| | | | | | | | | An accidental use of `tcSymbol` instead of `tcNat` in the `TypeLitNat` case of `mkTypeLitFromString` meant that it was possible to unsafely equate `Nat` with `Symbol`. A consequence of this is that you could write `unsafeCoerce`, as observed in #19288. This is fixed easily enough, thankfully. Fixes #19288.
* Documentation fixesKrzysztof Gogolewski2021-01-3015-60/+40
| | | | | | | | | | | | | | | - Add missing :since: for NondecreasingIndentation and OverlappingInstances - Remove duplicated descriptions for Safe Haskell flags and UndecidableInstances. Instead, the sections contain a link. - compare-flags: Also check for options supported by ghci. This uncovered two more that are not documented. The flag -smp was removed. - Formatting fixes - Remove the warning about -XNoImplicitPrelude - it was written in 1996, the extension is no longer dangerous. - Fix misspelled :reverse: flags Fixes #18958.
* Fix description of -fregs-graph (not implied by -O2, linked issue was closed)Benjamin Maurer2021-01-301-4/+1
|
* Fix -dynamic-too with wired-in modules (#19264)Sylvain Henry2021-01-304-12/+31
| | | | | | | | | | | | | See T19264 for a tricky corner case when explicitly importing GHC.Num.BigNat and another module. With -dynamic-too, the FinderCache contains paths for non-dynamic interfaces so they must be loaded first, which is usually the case, except for some interfaces loaded in the backend (e.g. in CorePrep). So we must run the backend for the non-dynamic way first for -dynamic-too to work as it is but I broke this invariant in c85f4928d4dbb2eb2cf906d08bfe7620d6f04ca5 by mistakenly making the backend run for the dynamic way first.
* Zonk the returned kind in tcFamTyPatsSimon Peyton Jones2021-01-303-0/+44
| | | | | | The motivation is given in Note [tcFamTyPats: zonking the result kind]. Fixes #19250 -- the fix is easy.
* compare-flags: Strip whitespace from flags read from --show-optionsGHC GitLab CI2021-01-301-2/+2
| | | | Otherwise we end up with terminating \r characters on Windows.
* hadrian: Introduce ghci-wrapper packageBen Gamari2021-01-305-16/+101
| | | | | This wraps the existing GHCi wrapper script (driver/ghci/ghci.c) in a cabal file and adds the package to Hadrian.
* configure: Break up AC_CONFIG_FILES listBen Gamari2021-01-301-1/+32
|
* ghci: Take editor from VISUAL environment variableBen Gamari2021-01-303-8/+25
| | | | | | Following the example of `git`, as noted in #19030. Fixes #19030.
* Fix parsing of -fstg-lift-lams-non-recKrzysztof Gogolewski2021-01-293-6/+4
| | | | | | | | -fstg-lift-lams-rec-* and -fstg-lift-lams-non-rec-* were setting the same field. Fix manual: -fstg-lift-lams-non-rec-args is disabled by -fstg-lift-lams-non-rec-args-any, there's no -fno-stg-lift-*.
* Make PatSyn immutableSimon Peyton Jones2021-01-2929-204/+203
| | | | | | | | | | Provoked by #19074, this patch makes GHC.Core.PatSyn.PatSyn immutable, by recording only the *Name* of the matcher and builder rather than (as currently) the *Id*. See Note [Keep Ids out of PatSyn] in GHC.Core.PatSyn. Updates haddock submodule.
* Fix check-uniques scriptKrzysztof Gogolewski2021-01-291-7/+7
| | | | | It was checking the old path compiler/prelude/*, outdated with the new module hierarchy. I added a sanity check to avoid this in the future.
* Ppr: compute length of string literals at compile time (#19266)Sylvain Henry2021-01-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | SDoc string literals created for example with `text "xyz"` are converted into `PtrString` (`Addr#` + size in bytes) with a rewrite rule to avoid allocating a String. Before this patch, the size in bytes was still computed at runtime. For every literal, we obtained the following pseudo STG: x :: Addr# x = "xzy"# s :: PtrString s = \u [] case ffi:strlen [x realWorld#] of (# _, sz #) -> PtrString [x sz] But since GHC 9.0, we can use `cstringLength#` instead to get: x :: Addr# x = "xzy"# s :: PtrString s = PtrString! [x 3#] Literals become statically known constructor applications. Allocations seem to decrease a little in perf tests (between -0.1% and -0.7% on CI).
* Warn about using quick with profilingLeif Metcalf2021-01-291-3/+4
|
* Add missing .hi-boot dependencies with ghc -M (#14482)Sylvain Henry2021-01-2910-2/+72
|
* Add explicit import lists to Data.List importsOleg Grenrus2021-01-2961-68/+71
| | | | | | | | | | | | | Related to a future change in Data.List, https://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/using-warnings.html?highlight=wcompat#ghc-flag--Wcompat-unqualified-imports Companion pull&merge requests: - https://github.com/judah/haskeline/pull/153 - https://github.com/haskell/containers/pull/762 - https://gitlab.haskell.org/ghc/packages/hpc/-/merge_requests/9 After these the actual change in Data.List should be easy to do.
* Remove StgLamLeif Metcalf2021-01-2911-67/+65
| | | | | | | | | | | | | | | | StgLam is used exclusively in the work of CoreToStg, but there's nothing in the type of StgExpr that indicates this, so we're forced throughout the Stg.* codebase to handle cases like: case expr of ... StgLam lam -> panic "Unexpected StgLam" ... This patch removes the StgLam constructor from the base StgExpr so these cases no longer need to be handled. Instead, we use a new intermediate type in CoreToStg, PreStgRhs, to represent the RHS expression of a binding.
* typecheck: Account for -XStrict in irrefutability checkBen Gamari2021-01-294-27/+71
| | | | | | | | | | | | | | | | | | | | | | When -XStrict is enabled the rules for irrefutability are slightly modified. Specifically, the pattern in a program like do ~(Just hi) <- expr cannot be considered irrefutable. The ~ here merely disables the bang that -XStrict would usually apply, rendering the program equivalent to the following without -XStrict do Just hi <- expr To achieve make this pattern irrefutable with -XStrict the user would rather need to write do ~(~(Just hi)) <- expr Failing to account for this resulted in #19027. To fix this isIrrefutableHsPat takes care to check for two the irrefutability of the inner pattern when it encounters a LazyPat and -XStrict is enabled.
* Fix strictness in TyCo.Tidy (#14738)Sylvain Henry2021-01-281-18/+38
| | | | | | | | | Metric Decrease: T12545 T14683 T16577 T5321Fun T5642
* Fix code formatting in `HasCallStack` sectionDenis Frezzato2021-01-281-1/+1
|