summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Hadrian: Add option to generate .hie files for stage1 librarieswip/hadrian-hieMatthew Pickering2019-08-056-5/+22
|
* Hadrian: make settings, platformConstants, etc dependencies of lib:ghcAlp Mestanogullari2019-08-024-18/+19
| | | | | | | | | | | This fixes #17003, where a user directly asked for the 'docs-haddock' target without building a complete stage 2 GHC first. Since haddock only depends on lib:ghc, the stage 2 GHC executable wasn't built, and neither were the settings, platformConstants, llvm-passes and llvm-targets files, since they are declared to be dependencies of exe:ghc. This makes sense in general since all GHC API users (haddock is one) will likely want those files to be there.
* Packages: Add timing for package database initializationBen Gamari2019-08-021-2/+7
|
* rts: Always truncate output filesBen Gamari2019-08-025-6/+6
| | | | | | | | | Previously there were numerous places in the RTS where we would fopen with the "w" flag string. This is wrong as it will not truncate the file. Consequently if we write less data than the previous length of the file we will leave garbage at its end. Fixes #16993.
* Add Note [withTiming] in compiler/main/ErrUtils.hsAlp Mestanogullari2019-08-021-0/+95
|
* compiler: emit finer grained codegen events to eventlogAlp Mestanogullari2019-08-025-48/+64
|
* docs: fixs -prof links in rts-flags sectionAdam Sandberg Eriksson2019-08-021-7/+6
|
* Remove build.nix.shKrzysztof Gogolewski2019-08-021-34/+0
| | | | | This file refers to shell.nix, which was removed in 430e6fedfda and c00d2f59d.
* Use injectiveVarsOfType to catch dodgy type family instance binders (#17008)Ryan Scott2019-08-028-90/+216
| | | | | | | | | | | | | | | | Previously, we detected dodgy type family instances binders by expanding type synonyms (via `exactTyCoVarsOfType`) and looking for type variables on the RHS that weren't mentioned on the (expanded) LHS. But this doesn't account for type families (like the example in #17008), so we instead use `injectiveVarsOfType` to only count LHS type variables that are in injective positions. That way, the `a` in `type instance F (x :: T a) = a` will not count if `T` is a type synonym _or_ a type family. Along the way, I moved `exactTyCoVarsOfType` to `TyCoFVs` to live alongside its sibling functions that also compute free variables. Fixes #17008.
* Rip out 9-year-old pattern variable hack (#17007)Ryan Scott2019-08-024-37/+23
| | | | | | | | | | | | | | | | | | GHC had an ad hoc validity check in place to rule out pattern variables bound by type synonyms, such as in the following example: ```hs type ItemColID a b = Int -- Discards a,b get :: ItemColID a b -> ItemColID a b get (x :: ItemColID a b) = x :: ItemColID a b ``` This hack is wholly unnecessary nowadays, since OutsideIn(X) is more than capable of instantiating `a` and `b` to `Any`. In light of this, let's rip out this validity check. Fixes #17007.
* Add StandaloneDeriving example for DerivingVia.Andreas Klebinger2019-08-021-0/+6
| | | | [skip-ci]
* Fix T16916 CI failures (#16966)Ivan Kasatenko2019-08-011-4/+8
| | | | | | | | | 1. Slightly increased the waiting time for the tested effect to be more profound. 2. Introduced measuring of the actual time spent waiting and adjusing CPU time by it to compensate for threadDelay waiting time inconsistencies.
* gitlab-ci: Fix it after upgradeBen Gamari2019-07-311-2/+2
| | | | | It seems that the regular expression parser changed in GitLab 12.1 and now does now support forward slashes in the RE, even when escaped.
* Work around redundant import issueBen Gamari2019-07-311-1/+1
| | | | | | | As mentioned in #16997, GHC currently complains about this import. In general I'm reluctant to paper over things like this but in the case of an hs-boot file I think adding an import list is the right thing to do regardless of the bug.
* Move tyConAppNeedsKindSig to TypeBen Gamari2019-07-314-276/+270
| | | | | Previously it was awkwardly in TyCoFVs (and before that in TyCoRep). Type seems like a sensible place for it to live.
* gitignore: Add .mypy_cacheBen Gamari2019-07-311-0/+1
|
* Break up TyCoRepBen Gamari2019-07-3129-2522/+2658
| | | | | | | | | | | | | | | | | | | | | | | | | | This breaks up the monstrous TyCoReps module into several new modules by topic: * TyCoRep: Contains the `Coercion`, `Type`, and related type definitions and a few simple predicates but nothing further * TyCoPpr: Contains the the pretty-printer logic * TyCoFVs: Contains the free variable computations (and `tyConAppNeedsKindSig`, although I suspect this should change) * TyCoSubst: Contains the substitution logic for types and coercions * TyCoTidy: Contains the tidying logic for types While we are able to eliminate a good number of `SOURCE` imports (and make a few others smaller) with this change, we must introduce one new `hs-boot` file for `TyCoPpr` so that `TyCoRep` can define `Outputable` instances for the types it defines. Metric Increase: haddock.Cabal haddock.compiler
* Apply a missing substitution in mkEtaWW (#16979)Simon Peyton Jones2019-07-304-8/+287
| | | | | | | | | | The `mkEtaWW` case for newtypes forgot to apply the substitution to the newtype coercion, resulting in the Core Lint errors observed in #16979. Easily fixed. Fixes #16979. Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
* Expand the preallocated Int range to [-16,255]Andreas Klebinger2019-07-302-2/+242
| | | | | | | | | | | | | | | | Effects as I measured them: RTS Size: +0.1% Compile times: -0.5% Runtine nofib: -1.1% Nofib runtime result seems to mostly come from the `CS` benchmark which is very sensible to alignment changes so this is likely over represented. However the compile time changes are realistic. This is related to #16961.
* hadrian: Drop a stale limitation tracking issueDale Wijnand2019-07-291-2/+0
| | | | | | | https://github.com/snowleopard/hadrian/issues/187 was superseded by https://github.com/snowleopard/hadrian/issues/669, which has also been closed. So, optimistically, dropping this as a limitation issue.
* Add Note [RuntimeRep and PrimRep] in RepTypeRichard Eisenberg2019-07-295-3/+177
| | | | | | | | | | Also adds Note [Getting from RuntimeRep to PrimRep], which deocuments a related thorny process. This Note addresses #16964, which correctly observes that documentation for this thorny design is lacking. Documentation only.
* hadrian: relink to the flavours doc in the ghc repoDale Wijnand2019-07-281-1/+1
|
* base: add Functor, Applicative, Monad, Alternative, MonadPlus, Generic and ↵Fumiaki Kinoshita2019-07-282-0/+46
| | | | Generic1 instances to Kleisli
* Add regression test for #16946nineonine2019-07-262-0/+13
|
* ghc-heap: implement WEAK closure type #16974Adam Sandberg Eriksson2019-07-267-0/+92
|
* reifyTypeOfThing: panic on impossible casesVladislav Zavialov2019-07-261-1/+4
|
* TemplateHaskell: reifyType (#16976)Vladislav Zavialov2019-07-2613-1/+104
|
* Change behaviour of -ddump-cmm-verbose to dump each Cmm pass output to a ↵nineonine2019-07-269-13/+58
| | | | separate file and add -ddump-cmm-verbose-by-proc to keep old behaviour (#16930)
* Banish reportFloatingViaTvs to the shadow realm (#15831, #16181)Ryan Scott2019-07-2616-159/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC used to reject programs of this form: ``` newtype Age = MkAge Int deriving Eq via Const Int a ``` That's because an earlier implementation of `DerivingVia` would generate the following instance: ``` instance Eq Age where (==) = coerce @(Const Int a -> Const Int a -> Bool) @(Age -> Age -> Bool) (==) ``` Note that the `a` in `Const Int a` is not bound anywhere, which causes all sorts of issues. I figured that no one would ever want to write code like this anyway, so I simply banned "floating" `via` type variables like `a`, checking for their presence in the aptly named `reportFloatingViaTvs` function. `reportFloatingViaTvs` ended up being implemented in a subtly incorrect way, as #15831 demonstrates. Following counsel with the sage of gold fire, I decided to abandon `reportFloatingViaTvs` entirely and opt for a different approach that would _accept_ the instance above. This is because GHC now generates this instance instead: ``` instance forall a. Eq Age where (==) = coerce @(Const Int a -> Const Int a -> Bool) @(Age -> Age -> Bool) (==) ``` Notice that we now explicitly quantify the `a` in `instance forall a. Eq Age`, so everything is peachy scoping-wise. See `Note [Floating `via` type variables]` in `TcDeriv` for the full scoop. A pleasant benefit of this refactoring is that it made it much easier to catch the problem observed in #16181, so this patch fixes that issue too. Fixes #15831. Fixes #16181.
* Printer: add an empty line between bindings in Rec STG binding groupsÖmer Sinan Ağacan2019-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Before: Rec { x2_r10T :: Lib.Bar [GblId, Unf=OtherCon []] = CCS_DONT_CARE Lib.Bar! [x3_r10U]; x3_r10U :: Lib.Foo [GblId, Unf=OtherCon []] = CCS_DONT_CARE Lib.Foo! [x1_r10p x2_r10T]; end Rec } After: Rec { x2_r10T :: Lib.Bar [GblId, Unf=OtherCon []] = CCS_DONT_CARE Lib.Bar! [x3_r10U]; x3_r10U :: Lib.Foo [GblId, Unf=OtherCon []] = CCS_DONT_CARE Lib.Foo! [x1_r10p x2_r10T]; end Rec }
* Make DefUses = OrdList DefUseRyan Scott2019-07-253-7/+10
| | | | | | | | | Before, `type DefUses = [DefUse]`. But lists are a terrible choice of data structure here, as we frequently append to the right of a `DefUses`, which yields some displeasing asymptotics. Let's instead use `OrdList`, which has constant-time appending to the right. This is one step on the way to #10347.
* Drop unused helpers 'mkTyClGroup' and 'emptyTyClGroup'Vladislav Zavialov2019-07-241-13/+1
|
* ASSERT(vis_flag==ForallInvis) in hsScopedTvsVladislav Zavialov2019-07-241-8/+53
|
* gitlab-ci: Fix source tarball jobBen Gamari2019-07-241-3/+5
| | | | | | | | | | * Use show! in source tarball job. Since we aren't actually building anything in this job `show` won't work. * Fix Docker image name * Make `version` file contain only version string
* Make stage 1 GHC target independentJohn Ericson2019-07-244-45/+7
| | | | | Now that the target macros are not being used, we remove them. This prevents target hardcoding regressions.
* Simon and I like to work in hsSyn, too.Richard Eisenberg2019-07-231-0/+1
|
* Hadrian: run the testsuite in Windows CI jobAlp Mestanogullari2019-07-233-11/+20
| | | | | | | | | | | | Since MR !1025 fixed the Windows build, allowing us to build a binary distribution, we can now run the testsuite in that CI job. This required fixing 'createFileLink': it should not try to create symlinks on Windows (that requires admin priviledges, which Hadrian can't assume). We now instead fall back to copying. This patch also removes some duplicated logic for iserv in the test rules, where we handle our dependency on the iserv binaries in a special way.
* Remove fix-submodules.pyÖmer Sinan Ağacan2019-07-232-60/+0
| | | | | Now that we have absolute paths for submodules (since a76b233d) we no longer need this script.
* Make sure to load interfaces when running :instancesXavier Denis2019-07-235-1/+32
|
* ghc-cabal: Use fromFlagOrDefault instead of fromFlagBen Gamari2019-07-211-2/+2
| | | | | As fromFlag is partial. The only case where we used fromFlag is when determining whether to strip libraries; we now assume that we shouldn't.
* Fix #8487: Debugger confuses variablesRoland Senn2019-07-217-13/+79
| | | | | | | | | | To display the free variables for a single breakpoint, GHCi pulls out the information from the fields `modBreaks_breakInfo` and `modBreaks_vars` of the `ModBreaks` data structure. For a specific breakpoint this gives 2 lists of types 'Id` (`Var`) and `OccName`. They are used to create the Id's for the free variables and must be kept in sync: If we remove an element from the Names list, then we also must remove the corresponding element from the OccNames list.
* Do not ignore events deletion when events to be added are provided (#16916)Ivan Kasatenko2019-07-214-4/+51
| | | | | | | | | | | Kqueue/kevent implementation used to ignore events to be unsubscribed from when events to be subscribed to were provided. This resulted in a lost notification subscription, when GHC runtime didn't listen for any events, yet the kernel considered otherwise and kept waking up the IO manager thread. This commit fixes this issue by always adding and removing all of the provided subscriptions.
* Expose the GhcPrelude module.Andreas Klebinger2019-07-211-3/+1
| | | | | | | | | | This makes it simpler to load Modules importing it when using ghc-the-package. ------------------------- Metric Decrease: haddock.compiler -------------------------
* hadrian: Remove RTS -Waggregate-return warningMatthew Pickering2019-07-201-1/+0
| | | This was removed from make in 077b92fa39839a8e83cd87398435424403cf6486
* Bump nofib submodule.Andreas Klebinger2019-07-201-0/+0
|
* Line wrap when pp long expressions (fixes #16874)Alfredo Di Napoli2019-07-205-2/+27
| | | | | This commit fixes #16874 by using `fsep` rather than `sep` when pretty printing long patterns and expressions.
* Added do-notation examples for Functor, Applicative and Monad combinators.Baldur Blöndal2019-07-204-0/+179
|
* Add module doc for Plugins.Richard Eisenberg2019-07-191-0/+5
| | | | This was requested in #15650.
* Don't maintainer-clean libraries/ghc-boot/ghc.mk (#16953)Ryan Scott2019-07-191-1/+5
| | | | | | | | | This makes the `maintainer-clean` rule in `ghc.mk` slightly more sophisticated so that it does not remove the version-controlled file `libraries/ghc-boot/ghc.mk`, which was checked into version control in commit 24782b89907ab36fb5aef3a17584f4c10f1e2690. Fixes #16953.
* users-guide: corrected -fmax-relevant-binds reverse to be ↵James Foster2019-07-191-3/+3
| | | | -fno-max-relevant-binds