summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make hadrian pass on the no-colour setting to GHC.wip/andreask/hadrian_no_colourAndreas Klebinger2020-03-311-0/+3
| | | | Fixes #17983.
* Expect T4267 to passSylvain Henry2020-03-301-2/+1
| | | | | Since 54250f2d8de910b094070c1b48f086030df634b1 we expected T4267 to fail, but it passes on CI.
* Minor cleanupKrzysztof Gogolewski2020-03-2910-53/+53
| | | | | | | - Simplify mkBuildExpr, the function newTyVars was called only on a one-element list. - TTG: use noExtCon in more places. This is more future-proof. - In zonkExpr, panic instead of printing a warning.
* Run checkNewDataCon before constraint-solving newtype constructorsRyan Scott2020-03-294-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Within `checkValidDataCon`, we used to run `checkValidType` on the argument types of a newtype constructor before running `checkNewDataCon`, which ensures that the user does not attempt non-sensical things such as newtypes with multiple arguments or constraints. This works out in most situations, but this falls over on a corner case revealed in #17955: ```hs newtype T = Coercible () T => T () ``` `checkValidType`, among other things, peforms an ambiguity check on the context of a data constructor, and that it turn invokes the constraint solver. It turns out that there is a special case in the constraint solver for representational equalities (read: `Coercible` constraints) that causes newtypes to be unwrapped (see `Note [Unwrap newtypes first]` in `TcCanonical`). This special case does not know how to cope with an ill formed newtype like `T`, so it ends up panicking. The solution is surprisingly simple: just invoke `checkNewDataCon` before `checkValidType` to ensure that the illicit newtype constructor context is detected before the constraint solver can run amok with it. Fixes #17955.
* gitlab-ci: Add FreeBSD release jobBen Gamari2020-03-291-0/+5
|
* Apply suggestion to libraries/base/Data/Bits.hsAndreas Klebinger2020-03-291-1/+1
|
* Correct haddocks for testBit in Data.BitsAndreas Klebinger2020-03-291-4/+8
| | | | | | | It conflated the nth bit with the bit at offset n. Now we instead give the definition in terms of `bit and `.&.` on top of clearer phrasing.
* testsuite: Remove test that dlopens a PIE object.Marius Bakke2020-03-294-21/+1
| | | | | glibc 2.30 disallowed dlopening PIE objects, so just remove the test. Fixes #17952.
* Store ComponentId detailsSylvain Henry2020-03-2915-95/+173
| | | | | | | | | | | | | | | | As far as GHC is concerned, installed package components ("units") are identified by an opaque ComponentId string provided by Cabal. But we don't want to display it to users (as it contains a hash) so GHC queries the database to retrieve some infos about the original source package (name, version, component name). This patch caches these infos in the ComponentId itself so that we don't need to provide DynFlags (which contains installed package informations) to print a ComponentId. In the future we want GHC to support several independent package states (e.g. for plugins and for target code), hence we need to avoid implicitly querying a single global package state.
* testsuite: Mark T12971 as broken on WindowsBen Gamari2020-03-291-1/+1
| | | | Due to #17945.
* testsuite: Fix T17786Ben Gamari2020-03-292-2/+2
| | | | Fix missing quoting and expected exit code.
* testsuite: Fix T17786 on WindowsBen Gamari2020-03-291-2/+2
| | | | Fixes line ending normalization issue.
* Demand analysis: simplify the demand for a RHSSimon Peyton Jones2020-03-2913-434/+445
| | | | | | | | | | | | | | | | | | | | | Ticket #17932 showed that we were using a stupid demand for the RHS of a let-binding, when the result is a product. This was the result of a "fix" in 2013, which (happily) turns out to no longer be necessary. So I just deleted the code, which simplifies the demand analyser, and fixes #17932. That in turn uncovered that the anticipation of worker/wrapper in CPR analysis was inaccurate, hence the logic that decides whether to unbox an argument in WW was extracted into a function `wantToUnbox`, now consulted by CPR analysis. I tried nofib, and got 0.0% perf changes. All this came up when messing about with !2873 (ticket #17917), but is idependent of it. Unfortunately, this patch regresses #4267 and realised that it is now blocked on #16335.
* Merge GHC.Types.CostCentre.Init into GHC.Driver.CodeOutputSylvain Henry2020-03-294-67/+56
|
* Remove GHC.Types.Unique.Map moduleSylvain Henry2020-03-292-207/+0
| | | | This module isn't used anywhere in GHC.
* Modules: Types (#13009)Sylvain Henry2020-03-29458-2383/+2411
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Use run-time tablesNextToCode in compiler exclusively (#15548)Joachim Breitner2020-03-267-37/+22
| | | | | | | | | | | | | | | | | Summary: - There is no more use of the TABLES_NEXT_TO_CODE CPP macro in `compiler/`. GHCI_TABLES_NEXT_TO_CODE is also removed entirely. The field within `PlatformMisc` within `DynFlags` is used instead. - The field is still not exposed as a CLI flag. We might consider some way to ensure the right RTS / libraries are used before doing that. Original reviewers: Original subscribers: TerrorJack, rwbarton, carter Original Differential Revision: https://phabricator.haskell.org/D5082
* Prepare to use run-time tablesNextToCode in compiler exclusivelyJoachim Breitner2020-03-262-61/+65
| | | | | | | Factor out CPP as much as possible to prepare for runtime determinattion. Progress towards #15548
* Remove unused `ghciTablesNextToCode` from compiler properJohn Ericson2020-03-261-8/+0
|
* Base: add markup around ExceptTristan Cacqueray2020-03-251-1/+1
|
* Base: add Control.Applicative optional exampleTristan Cacqueray2020-03-251-0/+17
| | | | | | This change adds an optional example. Tracking: #17929
* Base: fix a typo in liftA docTristan Cacqueray2020-03-251-1/+1
| | | | | | | This change removes an extra '|' that should not be rendered in the liftA documentation. Tracking: #17929
* DynFlags refactoring IIISylvain Henry2020-03-2548-927/+980
| | | | | | | | | | | | | Use Platform instead of DynFlags when possible: * `tARGET_MIN_INT` et al. replaced with `platformMinInt` et al. * no more DynFlags in PreRules: added a new `RuleOpts` datatype * don't use `wORD_SIZE` in the compiler * make `wordAlignment` use `Platform` * make `dOUBLE_SIZE` a constant Metric Decrease: T13035 T1969
* Do not panic on linker errorsPeter Trommler2020-03-257-3/+41
|
* Remove -fkill-absence and -fkill-one-shot flagsSebastian Graf2020-03-253-41/+3
| | | | | They seem to be a benchmarking vestige of the Cardinality paper and probably shouldn't have been merged to HEAD in the first place.
* Use export list of Main module in function TcRnDriver.hs:check_main (Fix #16453)Roland Senn2020-03-2521-45/+215
| | | | | | | | | | | | - Provide the export list of the `Main` module as parameter to the `compiler/typecheck/TcRnDriver.hs:check_main` function. - Instead of `lookupOccRn_maybe` call the function `lookupInfoOccRn`. It returns the list `mains_all` of all the main functions in scope. - Select from this list `mains_all` all `main` functions that are in the export list of the `Main` module. - If this new list contains exactly one single `main` function, then typechecking continues. - Otherwise issue an appropriate error message.
* Add example and doc for Arg (Fixes #17153)Paavo2020-03-241-1/+9
|
* Fix ApplicativeDo regression #17835Josef Svenningsson2020-03-236-21/+82
| | | | | | | A previous fix for #15344 made sure that monadic 'fail' is used properly when translating ApplicativeDo. However, it didn't properly account for when a 'fail' will be inserted which resulted in some programs failing with a type error.
* Annotate the non-total function in Data.Foldable as suchHécate2020-03-221-0/+20
|
* Bump hsc2hs submoduleBen Gamari2020-03-221-0/+0
|
* hadrian: Eliminate redundant .exe from GHC pathBen Gamari2020-03-221-1/+1
| | | | | | | | Previously we were invoking: bash -c "c:/GitLabRunner/builds/eEQrxK4p/0/ghc/ghc/toolchain/bin/ghc.exe.exe testsuite/mk/ghc-config.hs -o _build/test/bin/ghc-config.exe"
* gitlab-ci: Require that Windows-hadrian job passesGHC GitLab CI2020-03-221-3/+0
|
* hadrian: Fix executable extension passed to testsuite driverGHC GitLab CI2020-03-221-1/+1
|
* testsuite: Update expected output on WindowsGHC GitLab CI2020-03-225-4/+407
|
* testsuite: Fix TOP of T17786Ben Gamari2020-03-221-1/+1
|
* testsuite: Update expected output on WindowsBen Gamari2020-03-222-5/+0
|
* testsuite: Normalize slashes in ghc-api annotations outputBen Gamari2020-03-221-0/+3
| | | | | Enable `normalise_slashes` on `annotations`, `listcomps`, and `parseTree` to fix Windows failures.
* Bump process submoduleBen Gamari2020-03-221-0/+0
| | | | Avoids redundant case alternative warning.
* fs.h: Add missing declarations on WindowsBen Gamari2020-03-221-0/+7
|
* Fix event message in withTiming'Sergej Jaskiewicz2020-03-201-1/+1
| | | | This typo caused generating 'end' events without the corresponding 'begin' events.
* Update core spec to reflect changes to Core.Richard Eisenberg2020-03-2011-32/+135
| | | | | | | | | | | | Key changes: * Adds a new rule for forall-coercions over coercion variables, which was implemented but conspicuously missing from the spec. * Adds treatment for FunCo. * Adds treatment for ForAllTy over coercion variables. * Improves commentary (including restoring a Note lost in 03d4852658e1b7407abb4da84b1b03bfa6f6db3b) in the source. No changes to running code.
* Hadrian: ignore in-tree GMP objects with ``--lint``Sylvain Henry2020-03-202-4/+5
|
* Simplify treatment of heterogeneous equalityRichard Eisenberg2020-03-2035-534/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if we had a [W] (a :: k1) ~ (rhs :: k2), we would spit out a [D] k1 ~ k2 and part the W as irreducible, hoping for a unification. But we needn't do this. Instead, we now spit out a [W] co :: k2 ~ k1 and then use co to cast the rhs of the original Wanted. This means that we retain the connection between the spat-out constraint and the original. The problem with this new approach is that we cannot use the casted equality for substitution; it's too like wanteds-rewriting- wanteds. So, we forbid CTyEqCans that mention coercion holes. All the details are in Note [Equalities with incompatible kinds] in TcCanonical. There are a few knock-on effects, documented where they occur. While debugging an error in this patch, Simon and I ran into infelicities in how patterns and matches are printed; we made small improvements. This patch includes mitigations for #17828, which causes spurious pattern-match warnings. When #17828 is fixed, these lines should be removed.
* FastString: fix eager reading of string ptr in hashStrÖmer Sinan Ağacan2020-03-191-7/+13
| | | | | | | | | | | | | | | | | | | | | | | This read causes NULL dereferencing when len is 0. Fixes #17909 In the reproducer in #17909 this bug is triggered as follows: - SimplOpt.dealWithStringLiteral is called with a single-char string ("=" in #17909) - tailFS gets called on the FastString of the single-char string. - tailFS checks the length of the string, which is 1, and calls mkFastStringByteString on the tail of the ByteString, which is an empty ByteString as the original ByteString has only one char. - ByteString's unsafeUseAsCStringLen returns (NULL, 0) for the empty ByteString, which is passed to mkFastStringWith. - mkFastStringWith gets hash of the NULL pointer via hashStr, which fails on empty strings because of this bug.
* Refactoring: use Platform instead of DynFlags when possibleSylvain Henry2020-03-1960-2318/+2530
| | | | | | | | Metric Decrease: ManyConstructors T12707 T13035 T1969
* PmCheck: Use ConLikeSet to model negative infoSebastian Graf2020-03-192-17/+45
| | | | | | | | | | | | In #17911, Simon recognised many warnings stemming from over-long list unions while coverage checking Cabal's `LicenseId` module. This patch introduces a new `PmAltConSet` type which uses a `UniqDSet` instead of an association list for `ConLike`s. For `PmLit`s, it will still use an assocation list, though, because a similar map data structure would entail a lot of busy work. Fixes #17911.
* Update "GHC differences to the FFI Chapter" in user guide.Andreas Klebinger2020-03-191-15/+35
| | | | | | | | | The old entry had a heavy focus on how things had been. Which is not what I generally look for in a user guide. I also added a small section on behaviour of nested safe ffi calls. [skip-ci]
* Add release note about fix to #16502.Richard Eisenberg2020-03-181-0/+17
| | | | | | We thought we needed to update the manual, but the fix for #16502 actually brings the implementation in line with the manual. So we just alert users of how to update their code.
* Modules: Core operations (#13009)Sylvain Henry2020-03-1882-320/+327
|
* Fix #17021 by checking more return kindsRichard Eisenberg2020-03-1739-252/+589
| | | | | | | | | | All the details are in new Note [Datatype return kinds] in TcTyClsDecls. Test case: typecheck/should_fail/T17021{,b} typecheck/should_compile/T17021a Updates haddock submodule