summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Reduce code bloat in `Ord Literal` instance (#19443)wip/T19438Sebastian Graf2021-02-271-14/+5
| | | | | | | | | | | Reduce code bloat by replacing a call to `(==)` (which is defined in terms of `compare`) and to `compare` by a single call to `compare`, utilising the `Semigroup Ordering` instance. The compiler was eliminate the code bloat before, so this is a rather cosmetical improvement. Fixes #19443.
* Make `Ord Literal` deterministic (#19438)Sebastian Graf2021-02-271-1/+1
| | | | | | | | | | Previously, non-determinism arising from a use of `uniqCompareFS` in `cmpLit` potentially crept into `CoreMap`, which we expect to behave deterministically. So we simply use `lexicalCompareFS` now. Fixes #19438.
* gitlab-ci: Fix TEST_ARGS/RUNTEST_ARGS inconsistencyBen Gamari2021-02-272-3/+3
| | | | Finally fixes #19025.
* Include time.h in conc059_c (#19431)Sebastian Graf2021-02-271-0/+2
| | | | | | | The test probably could have used `usleep` from `unistd.h` instead, but this seemed like the simplest solution. Fixes #19431.
* CI: reduce xz compression for non release/nightly jobsSylvain Henry2021-02-271-0/+21
| | | | | | | | | | | | | | | | | | Reduce XZ compression level for regular jobs (it is bumped to 9 for releases and nightly jobs). In my experiments I've got the following bindist size in the given time for each compression level (with the quick flavour): XZ_OPT Time Size -9 4m06s 112 MB -8 4m00s 114 MB -7 3m50s 116 MB -6 (default) 3m40s 118 MB -5 2m47s 123 MB -4 1m57s 134 MB -3 1m03s 129 MB -2 49.73s 136 MB -1 37.72s 142 MB -0 34.40s 156 MB
* Fix Windows build with autoconf >=2.70 (#19189)Sylvain Henry2021-02-278-6898/+2
|
* touchy: use a valid cabal-versionSylvain Henry2021-02-271-1/+1
|
* Explain uninterruptibleMaskZubin Duggal2021-02-271-0/+1
|
* Remove unnecessary killThreadZubin Duggal2021-02-271-9/+6
|
* switch to using forkIO to detect async exceptionsZubin Duggal2021-02-271-16/+17
|
* Don't catch async exceptions when evaluating Template HaskellZubin Duggal2021-02-271-3/+20
|
* Fix typechecking time bug for large rationals (#15646)Andreas Klebinger2021-02-2719-101/+573
| | | | | | | | | When desugaring large overloaded literals we now avoid computing the `Rational` value. Instead prefering to store the significant and exponent as given where reasonable and possible. See Note [FractionalLit representation] for details.
* Remove the -xt heap profiling optionMatthew Pickering2021-02-279-60/+7
| | | | | | | It should be left to tooling to perform the filtering to remove these specific closure types from the profile if desired. Fixes #16795
* rts: Introduce --eventlog-flush-interval flagBen Gamari2021-02-274-0/+43
| | | | | | | This introduces a flag, --eventlog-flush-interval, which can be used to set an upper bound on the amount of time for which an eventlog event will remain enqueued. This can be useful in real-time monitoring settings.
* Move absentError into ghc-prim.Andreas Klebinger2021-02-268-6/+78
| | | | | | | | | | | | When using -fdicts-strict we generate references to absentError while compiling ghc-prim. However we always load ghc-prim before base so this caused linker errors. We simply solve this by moving absentError into ghc-prim. This does mean it's now a panic instead of an exception which can no longer be caught. But given that it should only be thrown if there is a compiler error that seems acceptable, and in fact we already do this for absentSumFieldError which has similar constraints.
* Reimplement Stream in "yoneda" style for efficiencyMatthew Pickering2021-02-266-111/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 'Stream' is implemented in the "yoneda" style for efficiency. By representing a stream in this manner 'fmap' and '>>=' operations are accumulated in the function parameters before being applied once when the stream is destroyed. In the old implementation each usage of 'mapM' and '>>=' would traverse the entire stream in order to apply the substitution at the leaves. It is well-known for free monads that this representation can improve performance, and the test results demonstrate this for GHC as well. The operation mapAccumL is not used in the compiler and can't be implemented efficiently because it requires destroying and rebuilding the stream. I removed one use of mapAccumL_ which has similar problems but the other use was difficult to remove. In the future it may be worth exploring whether the 'Stream' encoding could be modified further to capture the mapAccumL pattern, and likewise defer the passing of accumulation parameter until the stream is finally consumed. The >>= operation for 'Stream' was a hot-spot in the ticky profile for the "ManyConstructors" test which called the 'cg' function many times in "StgToCmm.hs" Metric Decrease: ManyConstructors
* Fix #19363 by using pprName' {Applied,Infix} in the right placesRyan Scott2021-02-265-27/+83
| | | | | | | | | | | | It was revealed in #19363 that the Template Haskell pretty-printer implemented in `Language.Haskell.TH.Ppr` did not pretty-print infix names or symbolic names correctly in certain situations, such as in data constructor declarations or fixity declarations. Easily fixed by using `pprName' Applied` (which always parenthesizes symbolic names in prefix position) or `pprName' Infix` (which always surrounds alphanumeric names with backticks in infix position) in the right spots. Fixes #19363.
* Implement -Wambiguous-fieldsAdam Gundry2021-02-2613-9/+140
| | | | | | Fixes #18966. Adds a new warning -Wambiguous-fields for uses of field selectors or record updates that will be rejected in the future, when the DuplicateRecordFields extension is simplified per https://github.com/ghc-proposals/ghc-proposals/pull/366.
* Update MonoLocalBinds documentationSimon Peyton Jones2021-02-262-11/+28
| | | | | | | | | Update the documentation to specify that MonoLocalBinds is lifted by a partial type signature. This came up in #19396. [skip ci]
* hadrian: ticky_ghc should build all things with -ticky (#19405) [skip ci]Sebastian Graf2021-02-261-3/+2
| | | | | | | With this patch, everything built by the stage1 compiler (in a `ticky_ghc`-transformed flavour) will be built with `-ticky`. Fixes #19405.
* Minor fix to QualifiedDo docs about the ApplicativeDo desugaringUtku Demir2021-02-251-3/+3
| | | | | | | | | When desugaring ApplicativeDo, GHC looks up the name `fmap`, not `<$>` (see 'GHC.Builtin.Names.fmapName'). This commit fixes the misleading documentation; since exporting the name `<$>` instead of `fmap` causes a "not in scope" error when `QualifiedDo` and `ApplicativeDo` is combined. [skip ci]
* gitlab-ci: Ignore performance test failures on DarwinBen Gamari2021-02-242-2/+9
| | | | Due to #19025.
* hadrian: Throw error on unknown key-value setting nameBen Gamari2021-02-241-2/+5
|
* hadrian: Introduce runtest.opts key-value settingBen Gamari2021-02-242-13/+26
|
* testsuite: Introduce flag to ignore performance failuresBen Gamari2021-02-243-1/+6
| | | | Needed by #19025.
* Revert "testsuite: Mark tests affected by #19025"Ben Gamari2021-02-241-14/+2
| | | | This reverts commit 4a9d856d21c67b3328e26aa68a071ec9a824a7bb.
* testsuite: Mark tests affected byBen Gamari2021-02-231-2/+14
|
* linker: Fix atexit handlers on PETamar Christina2021-02-222-3/+5
|
* Don't pass homeUnitId at ExternalPackageState creation time (#10827)Sylvain Henry2021-02-225-25/+23
| | | | | It makes the external package state independent of the home unit which is needed to make several home units share the EPS.
* Fix Storeable instances for the windows timeout executable.Andreas Klebinger2021-02-221-2/+2
| | | | | | alignment clearly should be a power of two. This patch makes it so. We do so by using the #alignment directive instead of using the size of the type.
* testsuite: Add broken tests for #19244Ben Gamari2021-02-223-0/+58
|
* testsuite: Mark foreignInterruptible as fragile in GHCiBen Gamari2021-02-221-0/+1
| | | | | As noted in #18391, foreignInterruptible fails pretty regularly under GHCi.
* ModuleOrigin: print details of module conflictSergei Trofimovich2021-02-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Before the change the error did not show details of involved module: ``` haddock: panic! (the 'impossible' happened) (GHC version 8.10.3: ModOrigin: hidden module redefined ``` After the change modile details are shown: ``` ghc-stage1: panic! (the 'impossible' happened) (GHC version 9.1.20210206: ModOrigin: package both exposed/hidden x: exposed package y: reexport by ghc-boot-9.1 ``` Fixes #19330 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Add test case for CompleteP pretty-printer (#19270)Ole Krüger2021-02-223-0/+9
|
* Fix TemplateHaskell pretty printer for CompleteP (#19270)Ole Krüger2021-02-221-1/+1
| | | | The COMPLETE pragma was not properly terminated with a '#-}'.
* Make CmmType field of LocalReg strictMatthew Pickering2021-02-221-1/+1
| | | | | This was observed to build up thunks which were forced by using a `-hi` profile and T3294 as a test.
* Make Width field in CmmType strictMatthew Pickering2021-02-221-1/+1
| | | | | This value is eventually forced so don't build up thunks. Observed with T3294 and -hi profile.
* Force gcp in assignArgumentsPosMatthew Pickering2021-02-221-2/+2
| | | | | | I observed this accumulating in the T3294 test only to be eventually forced (by a -hi profile). As it is only word big, forcing it saves quite a bit of allocation.
* Do not cas on slowpath of SpinLock unnecessarilyDylan Yudaken2021-02-221-3/+35
| | | | This is a well known technique to reduce inter-CPU bus traffic while waiting for the lock by reducing the number of writes.
* Move Hooks into HscEnvSylvain Henry2021-02-2217-86/+143
|
* Add the docspec:base rule to HadrianHécate2021-02-224-0/+63
|
* GHCi: Always show fixityLeif Metcalf2021-02-223-10/+22
| | | | | | | | | | | | | | | | | | | We used to only show the fixity of an operator if it wasn't the default fixity. Usually this was when the fixity was undeclared, but it could also arise if one declared the fixity of an operator as infixl 9, the default fixity. This commit makes it so that :i always shows the fixity of an operator, even if it is unset. We may want in the future to keep track of whether an operator's fixity is defined, so that we can print a comment like infixl 9 # -- Assumed, since no fixity is declared. for operators with no specified fixity, and so that we can print fixity of a term with a non-symbolic term when its fixity has been manually specified as infixl 9. Implements #19200.
* Ensure tcg_env is up-to-date when running typechecker pluginsalexbiehl2021-02-221-4/+8
|
* Prefer -Wmissing-signatures over -Wmissing-exported-signatures (#14794)Michiel de Bruijne2021-02-2219-21/+298
|
* Make openFile exception safeDavid Feuer2021-02-229-118/+432
| | | | | | | | | | | | | | | | | | | * `openFile` could sometimes leak file descriptors if it received an asynchronous exception (#19114, #19115). Fix this on POSIX. * `openFile` and more importantly `openFileBlocking` could not be interrupted effectively during the `open` system call (#17912). Fix this on POSIX. * Implement `readFile'` using `withFile` to ensure the file is closed promptly on exception. * Avoid `bracket` in `withFile`, reducing the duration of masking. Closes #19130. Addresses #17912, #19114, and #19115 on POSIX systems, but not on Windows.
* Improve handling of overloaded labels, literals, lists etcwip/T19154Simon Peyton Jones2021-02-1959-1027/+1449
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When implementing Quick Look I'd failed to remember that overloaded labels, like #foo, should be treated as a "head", so that they can be instantiated with Visible Type Application. This caused #19154. A very similar ticket covers overloaded literals: #19167. This patch fixes both problems, but (annoyingly, albeit temporarily) in two different ways. Overloaded labels I dealt with overloaded labels by buying fully into the Rebindable Syntax approach described in GHC.Hs.Expr Note [Rebindable syntax and HsExpansion]. There is a good overview in GHC.Rename.Expr Note [Handling overloaded and rebindable constructs]. That module contains much of the payload for this patch. Specifically: * Overloaded labels are expanded in the renamer, fixing #19154. See Note [Overloaded labels] in GHC.Rename.Expr. * Left and right sections used to have special code paths in the typechecker and desugarer. Now we just expand them in the renamer. This is harder than it sounds. See GHC.Rename.Expr Note [Left and right sections]. * Infix operator applications are expanded in the typechecker, specifically in GHC.Tc.Gen.App.splitHsApps. See Note [Desugar OpApp in the typechecker] in that module * ExplicitLists are expanded in the renamer, when (and only when) OverloadedLists is on. * HsIf is expanded in the renamer when (and only when) RebindableSyntax is on. Reason: the coverage checker treats HsIf specially. Maybe we could instead expand it unconditionally, and fix up the coverage checker, but I did not attempt that. Overloaded literals Overloaded literals, like numbers (3, 4.2) and strings with OverloadedStrings, were not working correctly with explicit type applications (see #19167). Ideally I'd also expand them in the renamer, like the stuff above, but I drew back on that because they can occur in HsPat as well, and I did not want to to do the HsExpanded thing for patterns. But they *can* now be the "head" of an application in the typechecker, and hence something like ("foo" @T) works now. See GHC.Tc.Gen.Head.tcInferOverLit. It's also done a bit more elegantly, rather than by constructing a new HsExpr and re-invoking the typechecker. There is some refactoring around tcShortCutLit. Ultimately there is more to do here, following the Rebindable Syntax story. There are a lot of knock-on effects: * HsOverLabel and ExplicitList no longer need funny (Maybe SyntaxExpr) fields to support rebindable syntax -- good! * HsOverLabel, OpApp, SectionL, SectionR all become impossible in the output of the typecheker, GhcTc; so we set their extension fields to Void. See GHC.Hs.Expr Note [Constructor cannot occur] * Template Haskell quotes for HsExpanded is a bit tricky. See Note [Quotation and rebindable syntax] in GHC.HsToCore.Quote. * In GHC.HsToCore.Match.viewLExprEq, which groups equal HsExprs for the purpose of pattern-match overlap checking, I found that dictionary evidence for the same type could have two different names. Easily fixed by comparing types not names. * I did quite a bit of annoying fiddling around in GHC.Tc.Gen.Head and GHC.Tc.Gen.App to get error message locations and contexts right, esp in splitHsApps, and the HsExprArg type. Tiresome and not very illuminating. But at least the tricky, higher order, Rebuilder function is gone. * Some refactoring in GHC.Tc.Utils.Monad around contexts and locations for rebindable syntax. * Incidentally fixes #19346, because we now print renamed, rather than typechecked, syntax in error mesages about applications. The commit removes the vestigial module GHC.Builtin.RebindableNames, and thus triggers a 2.4% metric decrease for test MultiLayerModules (#19293). Metric Decrease: MultiLayerModules T12545
* Test Driver: Tweak interval of test reportingMatthew Pickering2021-02-181-5/+12
| | | | | | | | | | | Rather than just display every 100 tests, work out how many to display based on the total number of tests. This improves the experience when running a small number of tests. For [0..100] - Report every test [100..1000] - Report every 10 tests [1000..10000] - Report every 100 tests and so on..
* users guide: Mention that -e can be given multiple timesBen Gamari2021-02-181-2/+3
| | | | Fixes #19122.
* base: Fix order of infix declarations in Data.FunctorBen Gamari2021-02-181-2/+2
| | | | | | | As pointed in #19284, previously the order was a bit confusing. This didn't affect the meaning but nevertheless it's much clearer now. Closes #19284.
* Rectify the haddock markup surrounding symbols for foldl' and foldMap'Hécate Moonlight2021-02-181-23/+23
| | | | closes #19365