summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add compile_flags.txt for clangd (C IDE) supportwip/clangd-supportSven Tennie2021-09-121-0/+5
| | | | | | This file configures clangd (C Language Server for IDEs) for the GHC project. Please note that this only works together with Haskell Language Server, otherwise .hie-bios/stage0/lib does not exist.
* Break recursion in GHC.Float.roundingMode# (#20352)Sebastian Graf2021-09-111-1/+1
| | | | | | | | | | | | | | | | Judging from the Assumption, we should never call `roundingMode#` on a negative number. Yet the strange "dummy" conversion from `IN` to `IP` and the following recursive call where making the function recursive. Replacing the call by a panic makes `roundingMode#` non-recursive, so that we may be able to inline it. Fixes #20352. It seems we trigger #19414 on some jobs, hence Metric Decrease: T12545
* ncg: Kill incorrect unreachable codeBen Gamari2021-09-111-3/+3
| | | | | | As noted in #18183, these cases were previously incorrect and unused. Closes #18183.
* Ensure that zapFragileUnfolding preseves evaluatednessBen Gamari2021-09-111-5/+5
| | | | | As noted in #20324, previously we would drop the fact that an unfolding was evaluated, despite what the documentation claims.
* Add performance test for #19695nineonine2021-09-112-0/+141
|
* Remove dubious Eq1 and Ord1 Fixed instances. Fixes #20309Oleg Grenrus2021-09-112-10/+0
|
* Add test for #18181nineonine2021-09-112-0/+14
|
* Canonicalize bignum literalsSylvain Henry2021-09-1124-248/+266
| | | | | | | | | | | | | | | | | | Before this patch Integer and Natural literals were desugared into "real" Core in Core prep. Now we desugar them directly into their final ConApp form in HsToCore. We only keep the double representation for BigNat# (literals larger than a machine Word/Int) which are still desugared in Core prep. Using the final form directly allows case-of-known-constructor to fire for bignum literals, fixing #20245. Slight increase (+2.3) in T4801 which is a pathological case with Integer literals. Metric Increase: T4801 T11545
* distrib: Drop FP_GMP from configure scriptBen Gamari2021-09-111-2/+0
| | | | | None of the configure options defined by `FP_GMP` are applicable to binary distributions.
* Only dump Core stats when requested to do so (#20342)Sylvain Henry2021-09-0825-190/+7
|
* EPA: Capture '+' location for NPlusKPatAlan Zimmerman2021-09-089-8/+74
| | | | | | | The location of the plus symbol was being discarded, we now capture it. Closes #20243
* rts: Factor out TRACE_ cache update logicBen Gamari2021-09-081-8/+18
| | | | Just a small refactoring to perhaps enable code reuse later.
* Documentation: use https linksKrzysztof Gogolewski2021-09-0836-85/+86
|
* Minor doc fixesKrzysztof Gogolewski2021-09-088-92/+58
| | | | | | | | | | | | | - Fix markup in 9.4 release notes - Document -ddump-cs-trace - Mention that ImpredicativeTypes is really supported only since 9.2 - Remove "There are some restrictions on the use of unboxed tuples". This used to be a list, but all those restrictions were removed. - Mark -fimplicit-import-qualified as documented - Remove "The :main and :run command" - duplicated verbatim in options - Avoid calling "main" a function (cf. #7816) - Update System.getArgs: the old location was before hierarchical modules - Note that multiplicity multiplication is not supported (#20319)
* ffi: Don't allow wrapper stub with CApi conventionMatthew Pickering2021-09-086-4/+28
| | | | Fixes #20272
* base: Numeric: remove 'Show' constraint on 'showIntAtBase'Guillaume Bouchard2021-09-082-7/+7
| | | | | | | | | | The constraint was there in order to show the 'Integral' value in case of error. Instead we can show the result of `toInteger`, which will be close (i.e. it will still show the same integer except if the 'Show' instance was funky). This changes a bit runtime semantic (i.e. exception string may be a bit different).
* Fix broken haddock @since fields in baseJoshua Price2021-09-085-3/+23
|
* base Data.Fixed: fix documentation typo: succ (0.000 :: Milli) /= 1.001 Jens Petersen2021-09-081-1/+1
| | | ie `succ (0000) == 0001` -- (not 1001)
* Let LLVM and C handle > native size arithmeticJohn Ericson2021-09-083-60/+67
| | | | | | NCG needs to call slow FFI functions where we "borrow" the C compiler's implementation, but there is no reason why we need to do that for LLVM, or the unregisterized backend where everything is via C anyways!
* Fix code example in the documentation of subsumptionARATA Mizuki2021-09-071-1/+1
|
* Add and use new constructors to TcRnMessageAlfredo Di Napoli2021-09-0715-130/+338
| | | | | | | | | | | | | This commit adds the following constructors to the TcRnMessage type and uses them to replace sdoc-based diagnostics in some parts of GHC (e.g. TcRnUnknownMessage). It includes: * Add TcRnMonomorphicBindings diagnostic * Convert TcRnUnknownMessage in Tc.Solver.Interact * Add and use the TcRnOrphanInstance constructor to TcRnMessage * Add TcRnFunDepConflict and TcRnDupInstanceDecls constructors to TcRnMessage * Add and use TcRnConflictingFamInstDecls constructor to TcRnMessage * Get rid of TcRnUnknownMessage from GHC.Tc.Instance.Family
* gitlab-ci: Fix bash version-dependence in ci.shBen Gamari2021-09-071-1/+3
| | | | | | As described in https://stackoverflow.com/questions/7577052, safely expanding bash arrays is very-nearly impossible. The previous incantation failed under the bash version shipped with Centos 7.
* hadrian: Ensure that settings is regenerated during bindist installationBen Gamari2021-09-073-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | Previously Hadrian would simply install the settings file generated in the build environment during the binary distribution installation. This is wrong since these environments may differ (e.g. different `cc` versions). We noticed on Darwin when installation of a binary distribution produced on a newer Darwin release resulted in a broken compiler due to the installed `settings` file incorrectly claiming that `cc` supported `-no-pie`. Fixing this sadly requires a bit of code duplication since `settings` is produced by Hadrian and not `configure`. For now I have simply duplicated the `settings` generation logic used by the Make build system into Hadrian's bindist Makefile. Ultimately the solution will probably involve shipping a freestanding utility to replace `configure`'s toolchain probing logic and generate a toolchain description file (similar to `settings`) as described in #19877. Fixes #20253.
* Bignum: refactor conversion rulesSylvain Henry2021-09-076-267/+319
| | | | | | | | * make "passthrough" rules non built-in: they don't need to * enhance note about efficient conversions between numeric types * make integerFromNatural a little more efficient * fix noinline pragma for naturalToWordClamp# (at least with non built-in rules, we get warnings in cases like this)
* GHCi: don't discard plugins on reload (#20335)Sylvain Henry2021-09-061-4/+7
| | | | Fix regression introduced in ecfd0278
* Define returnA = idOleg Grenrus2021-09-063-3/+7
|
* EPA: order of semicolons and comments for top-level decls is wrongAlan Zimmerman2021-09-069-56/+233
| | | | | | | | | | A comment followed by a semicolon at the top level resulted in the preceding comments being attached to the following declaration. Capture the comments as belonging to the declaration preceding the semicolon instead. Closes #20258
* fromEnum Natural: Throw error for non-representable valuesPeter Lebbing2021-09-065-4/+61
| | | | | | | | Starting with commit fe770c21, an error was thrown only for the values 2^63 to 2^64-1 inclusive (on a 64-bit machine), but not for higher values. Now, errors are thrown for all non-representable values again. Fixes #20291
* Convert diagnostics in GHC.Tc.Validity to proper TcRnMessage.hainq2021-09-0147-266/+617
| | | | | | | | | | | | | | | | | | | | - Add 19 new messages. Update test outputs accordingly. - Pretty print suggest-extensions hints: remove space before interspersed commas. - Refactor Rank's MonoType constructors. Each MonoType constructor should represent a specific case. With the Doc suggestion belonging to the TcRnMessage diagnostics instead. - Move Rank from Validity to its own `GHC.Tc.Types.Rank` module. - Remove the outdated `check_irred_pred` check. - Remove the outdated duplication check in `check_valid_theta`, which was subsumed by `redundant-constraints`. - Add missing test cases for quantified-constraints/T16474 & th/T12387a.
* Add a test for #20275ARATA Mizuki2021-08-283-0/+11
|
* AArch64 NCG: Emit FABS instructions for fabsFloat# and fabsDouble#ARATA Mizuki2021-08-284-4/+24
| | | | Closes #20275
* Convert IFace Rename Errors (#19927)Aaron Allen2021-08-279-20/+57
| | | | | | Converts uses of TcRnUnknownMessage in GHC.Iface.Rename. Closes #19927
* Export Solo from Data.TupleDavid Feuer2021-08-277-4/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | * The `Solo` type is intended to be the canonical lifted unary tuple. Up until now, it has only been available from `GHC.Tuple` in `ghc-prim`. Export it from `Data.Tuple` in `base`. I proposed this on the libraries list in December, 2020. https://mail.haskell.org/pipermail/libraries/2020-December/031061.html Responses from chessai https://mail.haskell.org/pipermail/libraries/2020-December/031062.html and George Wilson https://mail.haskell.org/pipermail/libraries/2021-January/031077.html were positive. There were no other responses. * Add Haddock documentation for Solo. * Give `Solo` a single field, `getSolo`, a custom `Show` instance that does *not* use record syntax, and a `Read` instance that accepts either record syntax or non-record syntax.
* GHC.Tc.Gen Diagnostics Conversion (Part 1)Aaron Allen2021-08-278-78/+319
| | | | | | | | Converts uses of `TcRnUnknownMessage` in these modules: - compiler/GHC/Tc/Gen/Annotation.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Bind.hs
* Fix GHC.Core.Subst.substDVarSetSimon Peyton Jones2021-08-264-17/+33
| | | | | | | substDVarSet looked up coercion variables in the wrong environment! The fix is easy. It is still a pretty strange looking function, but the bug is gone. This fixes another manifestation of #20200.
* CallArity: Consider shadowing introduced by case and field bindersSebastian Graf2021-08-264-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #20283, we saw a regression in `simple` due to CallArity for a very subtle reason: It simply didn't handle shadowing of case binders and constructor field binders! The test case T20283 has a very interesting binding `n_X1` that we want to eta-expand and that has a Unique (on GHC HEAD) that is reused by the Simplifier for a case binder: ``` let { n_X1 = ... } in ... let { lvl_s1Ul = ... case x_a1Rg of wild_X1 { __DEFAULT -> f_s1Tx rho_value_awA (GHC.Types.I# wild_X1); 0# -> lvl_s1TN } ... } in letrec { go3_X3 = \ (x_X4 :: GHC.Prim.Int#) (v_a1P9 [OS=OneShot] :: Double) -> let { karg_s1Wu = ... case lvl_s1Ul of { GHC.Types.D# y_a1Qf -> ... } } in case GHC.Prim.==# x_X4 y_a1R7 of { __DEFAULT -> go3_X3 (GHC.Prim.+# x_X4 1#) karg_s1Wu; 1# -> n_X1 karg_s1Wu -- Here we will assume that karg calls n_X1! }; } in go3_X3 0#; ``` Since the Case case of CallArity doesn't delete `X1` from the set of variables it is interested in knowing the usages of, we leak a very boring usage (of the case binder!) into the co-call graph that we mistakenly take for a usage of `n_X1`. We conclude that `lvl_s1Ul` and transitively `karg_s1Wu` call `n_X1` when really they don't. That culminates in the conclusion that `n_X1 karg_s1Wu` calls `n_X1` more than once. Wrong! Fortunately, this bug (which has been there right from CallArity's inception, I suppose) will never lead to a CallArity that is too optimistic. So by fixing this bug, we get strictly more opportunities for CallArity and all of them should be sound to exploit. Fixes #20283.
* Desugarer: Bring existentials in scope when substituting into record GADTsRyan Scott2021-08-253-3/+31
| | | | | | | | | | This fixes an outright bug in which the desugarer did not bring the existentially quantified type variables of a record GADT into `in_subst`'s in-scope set, leading to #20278. It also addresses a minor inefficiency in which `out_subst` was made into a substitution when a simpler `TvSubstEnv` would suffice. Fixes #20278.
* Fix colourised output in error messageswip/t20276Matthew Pickering2021-08-244-1/+8
| | | | | | | | | | | | | This fixes a small mistake in 4dc681c7c0345ee8ae268749d98b419dabf6a3bc which forced the dump rather than user style for error messages. In particular, this change replaced `defaultUserStyle` with `log_default_dump_context` rather than `log_default_user_context` which meant the PprStyle was PprDump rather than PprUser for error messages. https://gitlab.haskell.org/ghc/ghc/-/commit/4dc681c7c0345ee8ae268749d98b419dabf6a3bc?expanded=1&page=4#b62120081f64009b94c12d04ded5c68870d8c647_285_405 Fixes #20276
* Export PreloadUnitClosure as it is part of the public APIFendor2021-08-241-0/+1
|
* hadrian: Use cp -RP rather than -P in install to copy symlinksMatthew Pickering2021-08-241-1/+1
| | | | | | | | | | | | | For some inexplicable reason `-P` only takes effect on the mac version of p when you also pass `-R`. > Symbolic links are always followed unless the -R flag is set, in which case symbolic > links are not followed, by default. > -P If the -R option is specified, no symbolic links are followed. This is the > default. Fixes #20254
* Add plugin-recomp-change-2 testMatthew Pickering2021-08-234-0/+29
| | | | | | This test tests that if there are two modules which use a plugin specified on the command line then both are recompiled when the plugin changes.
* driver: Initialise common plugins once, before starting the pipelineMatthew Pickering2021-08-232-4/+4
| | | | | | | This fixes an error message regression and is a slight performance improvement. See #20250
* driver: Correctly pass custom messenger to logging functionMatthew Pickering2021-08-237-32/+36
| | | | This was an oversight from !6718
* TcPlugins: solve and report contras simultaneouslysheaf2021-08-233-35/+68
| | | | | | | | | | | | This changes the TcPlugin datatype to allow type-checking plugins to report insoluble constraints while at the same time solve some other constraints. This allows better error messages, as the plugin can still simplify constraints, even when it wishes to report a contradiction. Pattern synonyms TcPluginContradiction and TcPluginOk are provided for backwards compatibility: existing type-checking plugins should continue to work without modification.
* Doc fix #20226: formatting issues in 9.2.1 release notesAndreas Abel2021-08-231-3/+3
| | | | RST is brittle...
* Doc fix #20259: suggest bang patterns instead of case in hints.rstAndreas Abel2021-08-231-10/+4
|
* Convert lookupIdSubst panic back to a warning (#20200)Krzysztof Gogolewski2021-08-231-3/+5
|
* driver: Only check for unused package warning in after succesful downsweepMatthew Pickering2021-08-2310-22/+79
| | | | | | | | | Before we would check for the unused package warning even if the module graph was compromised due to an error in downsweep. This is easily fixed by pushing warmUnusedPackages into depanalE, and then returning the errors like the other downsweep errors. Fixes #20242
* Pmc: Better SCC annotations and trace outputSebastian Graf2021-08-234-49/+90
| | | | | | | | | | | | | While investigating #20106, I made a few refactorings to the pattern-match checker that I don't want to lose. Here are the changes: * Some key functions of the checker now have SCC annotations * Better `-ddump-ec-trace` diagnostics for easier debugging. I added 'traceWhenFailPm' to see *why* a particular `MaybeT` computation fails and made use of it in `instCon`. I also increased the acceptance threshold of T11545, which seems to fail randomly lately due to ghc/max flukes.
* hadrian: Use ghc version as suffix for all executablesMatthew Pickering2021-08-232-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` [matt@nixos:~/ghc-unique-spin]$ ls _build/bindist/ghc-9.3.20210813-x86_64-unknown-linux/bin/ ghc haddock runghc ghc-9.3.20210813 haddock-ghc-9.3.20210813 runghc-9.3.20210813 ghc-iserv hp2ps runhaskell ghc-iserv-dyn hp2ps-ghc-9.3.20210813 runhaskell-9.3.20210813 ghc-iserv-dyn-ghc-9.3.20210813 hpc unlit ghc-iserv-ghc-9.3.20210813 hpc-ghc-9.3.20210813 unlit-ghc-9.3.20210813 ghc-pkg hsc2hs ghc-pkg-9.3.20210813 hsc2hs-ghc-9.3.20210813 [matt@nixos:~/ghc-unique-spin]$ ls _build/bindist/ghc-9.3.20210813-x86_64-unknown-linux/wrappers/ ghc ghc-pkg-9.3.20210813 hpc runghc-9.3.20210813 ghc-9.3.20210813 haddock hpc-ghc-9.3.20210813 runhaskell ghci haddock-ghc-9.3.20210813 hsc2hs runhaskell-9.3.20210813 ghci-9.3.20210813 hp2ps hsc2hs-ghc-9.3.20210813 ghc-pkg hp2ps-ghc-9.3.20210813 runghc ``` See the discussion on #19571 where we decided that it was most sensible to use the same version number as a suffix for all executables. For those whose version number is different to normal (for example, haddock as it's own versioning scheme) the additional "ghc" suffix is used. Cabal already knows to look for this suffix so should work nicely with existing tooling.