summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update expected-undocumented-flags.txtwip-cptwunderlich-docflag-dasm-lint-ghc-9.0Benjamin Maurer2021-01-091-1/+0
|
* Document flag -dasm-lint in debugging.rstBenjamin Maurer2021-01-091-0/+7
|
* Hadrian: show default ghc-bignum backend (fix #18912)Sylvain Henry2021-01-071-2/+2
|
* docs: Various release notes changesBen Gamari2021-01-071-9/+20
| | | | | | * Mention changed in profiler's treatment of PINNED closures * Fix formatting * Move plugins-relevant changes to GHC API section
* rts/Sanity: Allow DEAD_WEAKs in weak pointer listBen Gamari2021-01-071-1/+1
| | | | | | | The weak pointer check in `checkGenWeakPtrList` previously failed to account for dead weak pointers. This caused `fptr01` to fail in the `sanity` way. Fixes #19162.
* rts/Linker: Add noreturn to loadNativeObj on non-ELF platformsBen Gamari2021-01-071-2/+6
|
* testsuite: Add test for #19149Ben Gamari2021-01-074-0/+51
|
* compiler: Initialize ForeignExportsList.n_entriesBen Gamari2021-01-071-1/+4
| | | | | | | | | | The refactoring in ed57c3a9eb9286faa222f98e484a9ef3432b2025 failed to initialize this field, resulting in no exports being registered. A very silly bug and yet somehow none of our tests caught it. See #18548. Fixes #19149.
* GHCi: Fill field `DynFlags.dumpPrefix`. (Fixes #17500)Roland Senn2021-01-078-6/+45
| | | | | | | | | | | For interactive evaluations set the field `DynFlags.dumpPrefix` to the GHCi internal module name. The GHCi module name for an interactive evaluation is something like `Ghci9`. To avoid user confusion, don't dump any data for GHCi internal evaluations. Extend the comment for `DynFlags.dumpPrefix` and fix a little typo in a comment about the GHCi internal module names.
* Make primops for `{Int,Word}32#`John Ericson2021-01-0722-18/+843
| | | | | | | | | | | | | Progress towards #19026. The type was added before, but not its primops. We follow the conventions in 36fcf9edee31513db2ddbf716ee0aa79766cbe69 and 2c959a1894311e59cd2fd469c1967491c1e488f3 for names and testing. Along with the previous 8- and 16-bit primops, this will allow us to avoid many conversions for 8-, 16-, and 32-bit sized numeric types. Co-authored-by: Sylvain Henry <hsyl20@gmail.com>
* users-guide: Remove space from -ol documentationBen Gamari2021-01-071-2/+2
| | | | This flag requires that there be no space between the filename and the argument.
* rts: Enforce that mark-region isn't used with -hBen Gamari2021-01-072-0/+21
| | | | | | | As noted in #9666, the mark-region GC is not compatible with heap profiling. Also add documentation for this flag. Closes #9666.
* rts: Zero shrunk array slop in vanilla RTSBen Gamari2021-01-073-5/+16
| | | | | | But only when profiling or DEBUG are enabled. Fixes #17572.
* Storage: Unconditionally enable zeroing of alignment slopBen Gamari2021-01-071-11/+11
| | | | This is necessary since the user may enable `+RTS -hT` at any time.
* rts: Implement heap census support for pinned objectsBen Gamari2021-01-071-29/+21
| | | | | It turns out that this was fairly straightforward to implement since we are now pretty careful about zeroing slop.
* rts: Break up census logicBen Gamari2021-01-071-176/+187
| | | | | Move the logic for taking censuses of "normal" and pinned blocks to their own functions.
* Implement Unique supply with Addr# atomic primopSylvain Henry2021-01-0510-184/+101
| | | | | | | | Before this patch the compiler depended on the RTS way (threaded or not) to use atomic incrementation or not. This is wrong because the RTS is supposed to be switchable at link time, without recompilation. Now we always use atomic incrementation of the unique counter.
* Rename internal primpos ahead of !4492John Ericson2021-01-033-58/+58
| | | | | I'm not sure how long the submodule dance is going to take, sadly, so I'd like to chip away at things in the meantime / avoid conflicts.
* Maintain invariant: MVars on mut_list are dirtyViktor Dukhovni2021-01-032-0/+3
| | | | | | | | | | | | The fix for 18919 was somewhat incomplete: while the MVars were correctly added to the mut_list via dirty_MVAR(), their info table remained "clean". While this is mostly harmless in non-debug builds, but trips an assertion in the debug build, and may result in the MVar being needlessly being added to the mut_list multiple times. Resolves: #19145
* Add the Data.Foldable strictness optimisations to base's changelogHécate2021-01-031-0/+3
|
* Add regression test for #18467wip/T18467Simon Peyton Jones2021-01-023-0/+31
|
* Don't use absentError thunks for strict constructor fieldsSimon Peyton Jones2021-01-027-77/+172
| | | | | | | | | | | | | | | | This patch fixes #19133 by using LitRubbish for strict constructor fields, even if they are of lifted types. Previously LitRubbish worked only for unlifted (but boxed) types. The change is very easy, although I needed a boolean field in LitRubbish to say whether or not it is lifted. (That seemed easier than giving it another type argument. This is preparing for Andreas's work on establishing the invariant that strict constructor fields are always tagged and evaluated (see #16970). Meanwhile, nothing was actually wrong before, so there are no tests.
* Use EmptyCase instead of undefined in Generics exampleAsad Saeeduddin2021-01-021-6/+6
| | | | Fixes #19124
* Correct doctestsOleg Grenrus2021-01-0224-38/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's simpler to assume that base is NoImplicitPrelude, otherwise running doctest on `GHC.*` modules would be tricky. OTOH, most `GHC.List` (where the most name clashes are) examples could be changed to use `import qualified Data.List as L`. (GHC.List examples won't show for Foldable methods...). With these changes majority of doctest examples are GHCi-"faithful", my WIP GHC-independent doctest runner reports nice summary: Examples: 582; Tried: 546; Skipped: 34; Success: 515; Errors: 33; Property Failures 2 Most error cases are *Hangs forever*. I have yet to figure out how to demonstrate that in GHCi. Some of divergences are actually stack overflows, i.e. caught by runtime. Few errorful cases are examples of infinite output, e.g. >>> cycle [42] [42,42,42,42,42,42,42,42,42,42... while correct, they confuse doctest. Another erroneous cases are where expected output has line comment, like >>> fmap show (Just 1) -- (a -> b) -> f a -> f b Just "1" -- (Int -> String) -> Maybe Int -> Maybe String I think I just have to teach doctest to strip comments from expected output. This is a first patch in a series. There is plenty of stuff already.
* Upstream the strictness optimisation for GHC.List.{maximum,minimum}Hécate2021-01-021-2/+2
|
* Upstream the strictness optimisation for GHC.List.{sum,product}Hécate2021-01-021-2/+2
|
* rts: update usage text for new -A defaultDouglas Wilson2021-01-021-1/+1
|
* Docs: Remove reference to `type_applications` in `exts/patterns.rst`Joachim Breitner2021-01-021-1/+0
| | | | | it is unclear why it is there, and it is _also_ linked from `exts/types.rst`.
* Establish invariant (GivenInv)Simon Peyton Jones2021-01-0218-146/+297
| | | | | | | | | | | | | | | | | | This patch establishes invariant (GivenInv) from GHC.Tc.Utils.TcType Note [TcLevel invariants]. (GivenInv) says that unification variables from level 'n' should not appear in the Givens for level 'n'. See Note [GivenInv] in teh same module. This invariant was already very nearly true, but a dark corner of partial type signatures made it false. The patch re-jigs partial type signatures a bit to avoid the problem, and documents the invariant much more thorughly Fixes #18646 along the way: see Note [Extra-constraints wildcards] in GHC.Tc.Gen.Bind I also simplified the interface to tcSimplifyInfer slightly, so that it /emits/ the residual constraint, rather than /returning/ it.
* rts/Messages: Relax locked-closure assertionBen Gamari2021-01-021-2/+3
| | | | | | | In general we are less careful about locking closures when running with only a single capability. Fixes #19075.
* base: add Numeric.{readBin, showBin} (fix #19036)Artem Pelenitsyn2021-01-028-14/+34
|
* Make proper fixed-width number literalsSylvain Henry2021-01-025-198/+176
| | | | | | | | (Progress towards #11953, #17377, #17375) Besides being nicer to use, this also will allow for better constant folding for the fixed-width types, on par with what `Int#` and `Word#` have today.
* INLINE pragma for patterns (#12178)Cale Gibbard2020-12-3118-20/+248
| | | | | Allow INLINE and NOINLINE pragmas to be used for patterns. Those are applied to both the builder and matcher (where applicable).
* Put hole instantiation typechecking in the module graph and fix driver batch ↵John Ericson2020-12-28108-549/+1145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode backpack edges Backpack instantiations need to be typechecked to make sure that the arguments fit the parameters. `tcRnInstantiateSignature` checks instantiations with concrete modules, while `tcRnCheckUnit` checks instantiations with free holes (signatures in the current modules). Before this change, it worked that `tcRnInstantiateSignature` was called after typechecking the argument module, see `HscMain.hsc_typecheck`, while `tcRnCheckUnit` was called in `unsweep'` where-bound in `GhcMake.upsweep`. `tcRnCheckUnit` was called once per each instantiation once all the argument sigs were processed. This was done with simple "to do" and "already done" accumulators in the fold. `parUpsweep` did not implement the change. With this change, `tcRnCheckUnit` instead is associated with its own node in the `ModuleGraph`. Nodes are now: ```haskell data ModuleGraphNode -- | Instantiation nodes track the instantiation of other units -- (backpack dependencies) with the holes (signatures) of the current package. = InstantiationNode InstantiatedUnit -- | There is a module summary node for each module, signature, and boot module being built. | ModuleNode ExtendedModSummary ``` instead of just `ModSummary`; the `InstantiationNode` case is the instantiation of a unit to be checked. The dependencies of such nodes are the same "free holes" as was checked with the accumulator before. Both versions of upsweep on such a node call `tcRnCheckUnit`. There previously was an `implicitRequirements` function which would crawl through every non-current-unit module dep to look for all free holes (signatures) to add as dependencies in `GHC.Driver.Make`. But this is no good: we shouldn't be looking for transitive anything when building the graph: the graph should only have immediate edges and the scheduler takes care that all transitive requirements are met. So `GHC.Driver.Make` stopped using `implicitRequirements`, and instead uses a new `implicitRequirementsShallow`, which just returns the outermost instantiation node (or module name if the immediate dependency is itself a signature). The signature dependencies are just treated like any other imported module, but the module ones then go in a list stored in the `ModuleNode` next to the `ModSummary` as the "extra backpack dependencies". When `downsweep` creates the mod summaries, it adds this information too. ------ There is one code quality, and possible correctness thing left: In addition to `implicitRequirements` there is `findExtraSigImports`, which says something like "if you are an instantiation argument (you are substituted or a signature), you need to import its things too". This is a little non-local so I am not quite sure how to get rid of it in `GHC.Driver.Make`, but we probably should eventually. First though, let's try to make a test case that observes that we don't do this, lest it actually be unneeded. Until then, I'm happy to leave it as is. ------ Beside the ability to use `-j`, the other major user-visibile side effect of this change is that that the --make progress log now includes "Instantiating" messages for these new nodes. Those also are numbered like module nodes and count towards the total. ------ Fixes #17188 Updates hackage submomdule Metric Increase: T12425 T13035
* Test cases for #15772 and #17139.Richard Eisenberg2020-12-256-0/+125
|
* Use mutable update to defer out-of-scope errorsRichard Eisenberg2020-12-2521-84/+143
| | | | | | | | | | | | | Previously, we let-bound an identifier to use to carry the erroring evidence for an out-of-scope variable. But this failed for levity-polymorphic out-of-scope variables, leading to a panic (#17812). The new plan is to use a mutable update to just write the erroring expression directly where it needs to go. Close #17812. Test case: typecheck/should_compile/T17812
* Use `hscFrontendHook` againJohn Ericson2020-12-241-2/+5
| | | | | | In eb629fab I accidentally got rid of it when inlining tons of helpers. Closes #19004
* Refactor renamer datastructuresAdam Gundry2020-12-2473-743/+1207
| | | | | | | | | | | | | | | This patch significantly refactors key renamer datastructures (primarily Avail and GlobalRdrElt) in order to treat DuplicateRecordFields in a more robust way. In particular it allows the extension to be used with pattern synonyms (fixes where mangled record selector names could be printed instead of field labels (e.g. with -Wpartial-fields or hole fits, see new tests). The key idea is the introduction of a new type GreName for names that may represent either normal entities or field labels. This is then used in GlobalRdrElt and AvailInfo, in place of the old way of representing fields using FldParent (yuck) and an extra list in AvailTC. Updates the haddock submodule.
* Require ScopedTypeVariables+TypeApplications to use type applications in ↵Ryan Scott2020-12-2431-22/+67
| | | | | | patterns Fixes #19109.
* Clone the binders of a SAKS where necessarySimon Peyton Jones2020-12-247-28/+117
| | | | | | | | | | | | | | Given a kind signature type T :: forall k. k -> forall k. k -> blah data T a b = ... where those k's have the same unique (which is possible; see #19093) we were giving the tyConBinders in tycon T the same unique, which caused chaos. Fix is simple: ensure uniqueness when decomposing the kind signature. See GHC.Tc.Gen.HsType.zipBinders
* Document scoping of named wildcard type variablesSimon Peyton Jones2020-12-231-0/+14
| | | | | | See `Note [Scoping of named wildcards]` in GHC.Hs.Type This lack of documentation came up in #19051.
* spelling: thead -> threadDouglas Wilson2020-12-232-3/+3
|
* Support package qualifier in Prelude importSylvain Henry2020-12-236-5/+31
| | | | Fix #19082, #17045
* WorkWrap: Unbox constructors with existentials (#18982)Sebastian Graf2020-12-2314-234/+542
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider ```hs data Ex where Ex :: e -> Int -> Ex f :: Ex -> Int f (Ex e n) = e `seq` n + 1 ``` Worker/wrapper should build the following worker for `f`: ```hs $wf :: forall e. e -> Int# -> Int# $wf e n = e `seq` n +# 1# ``` But previously it didn't, because `Ex` binds an existential. This patch lifts that condition. That entailed having to instantiate existential binders in `GHC.Core.Opt.WorkWrap.Utils.mkWWstr` via `GHC.Core.Utils.dataConRepFSInstPat`, requiring a bit of a refactoring around what is now `DataConPatContext`. CPR W/W still won't unbox DataCons with existentials. See `Note [Which types are unboxed?]` for details. I also refactored the various `tyCon*DataCon(s)_maybe` functions in `GHC.Core.TyCon`, deleting some of them which are no longer needed (`isDataProductType_maybe` and `isDataSumType_maybe`). I cleaned up a couple of call sites, some of which weren't very explicit about whether they cared for existentials or not. The test output of `T18013` changed, because we now unbox the `Rule` data type. Its constructor carries existential state and will be w/w'd now. In the particular example, the worker functions inlines right back into the wrapper, which then unnecessarily has a (quite big) stable unfolding. I think this kind of fallout is inevitable; see also Note [Don't w/w inline small non-loop-breaker things]. There's a new regression test case `T18982`. Fixes #18982.
* DmdAnal: Keep alive RULE vars in LetUp (#18971)Sebastian Graf2020-12-233-85/+67
| | | | I also took the liberty to refactor the logic around `ruleFVs`.
* mkDocs: address shellcheck issuesAdam Sandberg Ericsson2020-12-221-4/+4
|
* mkDocs: fix extraction of Win32 docs from hadrian bindistAdam Sandberg Ericsson2020-12-222-4/+6
|
* Increase -A default to 4MB.Andreas Klebinger2020-12-224-15/+23
| | | | | | | | | | | This gives a small increase in performance under most circumstances. For single threaded GC the improvement is on the order of 1-2%. For multi threaded GC the results are quite noisy but seem to fall into the same ballpark. Fixes #16499
* Require alex < 3.2.6Ryan Scott2020-12-222-1/+4
| | | | A workaround for #19099.
* Add Monoid instances for Product and ComposeJoe Hermaszewski2020-12-223-0/+14
| | | | Semigroup too of course