summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use C99's boolBen Gamari2016-11-29103-994/+954
| | | | | | | | | | | | Test Plan: Validate on lots of platforms Reviewers: erikd, simonmar, austin Reviewed By: erikd, simonmar Subscribers: michalt, thomie Differential Revision: https://phabricator.haskell.org/D2699
* Fix type of GarbageCollect declarationBen Gamari2016-11-291-1/+1
| | | | | | | | | | Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2764
* Make globals use sharedCAFMoritz Angermann2016-11-2914-182/+156
| | | | | | | | | | | | | | | The use of globals is quite painful when multiple rts are loaded, e.g. when plugins are loaded, which bring in a second rts. The sharedCAF appraoch was employed for the FastStringTable; I've taken the libery to extend this to the other globals I could find. Reviewers: rwbarton, simonmar, austin, hvr, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2575
* hschooks.c: Ensure correct header file is includedBen Gamari2016-11-291-1/+8
| | | | | | | | | | | | | | | | Consider the case of building a stage1 compiler. `hschooks.c` will be built by stage0 `ghc` and linked against the `stage0` RTS. Despite this it was #including the stage1 `Rts.h`. There is, of course, no guarantee that this is ABI-compatible with the stage0 RTS and when they diverge Bad Things happen (e.g. bells ringing at inappropriate times in D2699). Test Plan: Validate Reviewers: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2763
* testsuite: Bump haddock.compiler allocationsBen Gamari2016-11-291-0/+1
| | | | Unfortunately it's quite unclear what caused this.
* OrdList: Add Foldable, Traversable instancesBen Gamari2016-11-291-3/+9
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2740
* NCGMonad: Add MonadUnique NatM instanceBen Gamari2016-11-291-0/+8
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2737
* AsmCodeGen: Refactor worker in cmmNativeGensBen Gamari2016-11-291-10/+13
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin, simonmar, michalt Reviewed By: simonmar, michalt Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2736
* Use newBlockId instead of newLabelCBen Gamari2016-11-2911-41/+48
| | | | | | | | | | | | | | | This seems like a clearer name and the fewer functions that one needs to remember, the better. Test Plan: validate Reviewers: austin, simonmar, michalt Reviewed By: simonmar, michalt Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2735
* Purge GHC of literate PerlDemi Obenour2016-11-296-25/+15
| | | | | | | | | | | | | | Test Plan: GHC CI Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: snowleopard, thomie Maniphest Tasks: T74 Differential Revision: https://phabricator.haskell.org/D2732
* Refactor Pattern Match Checker to use ListTMatthew Pickering2016-11-293-111/+287
| | | | | | | | | | Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2725
* Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry2016-11-29173-618/+623
| | | | | | | | | | | | | | | | | | | | | This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
* testsuite: Mention CLEANUP option in READMEBen Gamari2016-11-291-0/+2
| | | | | | | | | | Test Plan: Read it Reviewers: austin Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2747
* Minor cleanup of foldRegs{Used,Defd}Michal Terepeta2016-11-292-43/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the two functions strict in the accumulator - it seems that there are only two users of those functions: `CmmLive` and `CmmSink` and in both cases the strict fold fits better. The commit also removes a few unused functions (`filterRegsUsed`), instances (for `Maybe` and `RegSet`) and gets rid of unnecessary inculde of `HsVersions.h`. The performance effect of avoiding unnecessary thunks is mostly negligible, although we do allocate a tiny bit less (nofib's section on compile allocations): ``` -1 s.d. ----- -0.2% +1 s.d. ----- -0.1% Average ----- -0.2% ``` Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: validate Reviewers: simonmar, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2723
* Detect color supportPhil Ruffwind2016-11-292-2/+107
| | | | | | | | | | | | | | Test Plan: validate Reviewers: erikd, Phyx, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2717 GHC Trac Issues: #8809
* Make diagnostics slightly more colorfulPhil Ruffwind2016-11-296-23/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preliminary commit to add colors to diagnostics (warning and error messages). The aesthetic changes are: - 'warning', 'error', and 'fatal' are all colored magenta, red, and red respectively. - The warning annotation [-Wsomething] shares the same color. - Warnings and errors are also bolded (this is consistent with what other compilers do). A new flag has been added to control the behavior: -fdiagnostics-color=(always|auto|never) This flag is 'auto' by default. However, auto-detection is not implemented yet, so it effectively it defaults to off. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2716 GHC Trac Issues: #8809
* users_guide: Bring 8.0.2 release notes up-to-date with ghc-8.0 branchBen Gamari2016-11-291-49/+83
| | | | | I've been editing the release notes on the `ghc-8.0` branch; fold those changes into `master`.
* Define thread primitives if they're supported.Shea Levy2016-11-292-39/+44
| | | | | | | | | | | | | | | | | | | On iOS, we use the pthread-based implementation of Itimer.c even for a non-threaded RTS. Since 999c464, this relies on synchronization primitives like Mutex, so ensure those primitives are defined whenever they are supported, even if !THREADED_RTS. Fixes #12799. Reviewers: erikd, austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2712 GHC Trac Issues: #12799
* Store string as parsed in SourceText for CImportAlan Zimmerman2016-11-291-1/+1
|
* Typos in commentsGabor Greif2016-11-297-8/+8
|
* Zonk the free tvs of a RULE lhs to TyVarsSimon Peyton Jones2016-11-293-8/+16
| | | | | | | | | | | | Previously we were making them into skolem TcTyVars, which is wrong for the output of the type checker, which no TcTyVars should surive. See Note [Zonking the LHS of a RULE] in TcHsSyn This was flushed out by the new IfaceTcTyVar thing; I found some more TcTyVars that were being serialised into an interface file, which is wrong wrong wrong.
* Make note of #12881 in 8.0.2 release notesRyan Scott2016-11-291-0/+15
| | | | | | | | | | | | | | | | Summary: Resolves #12881. Test Plan: Read it, commit it, merge it, ship it Reviewers: hvr, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2760 GHC Trac Issues: #12881
* Comments only (related to #12789)Simon Peyton Jones2016-11-284-74/+76
| | | | | | It took me some time to find the right Note for the fix to #12789. This comment patch tries to add pointers from relevant places.
* Test Trac #12885Simon Peyton Jones2016-11-282-0/+13
| | | | | | | | | | ...which is fixed by commit 0476a64e70c91b326b53db2fc55adbbaa8e5c270 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Tue Oct 25 15:22:17 2016 +0100 Fix a bug in mk_superclasses_of
* Test Trac #12776Simon Peyton Jones2016-11-282-0/+43
|
* Typos in comments only [ci skip]Gabor Greif2016-11-285-8/+8
|
* Fix an long-standing bug in OccurAnalSimon Peyton Jones2016-11-281-89/+139
| | | | | | | | | | | | | | | | | | | | | | | | | This bug was beautifully characterised in Trac #12776, which showed a small program for which the inliner went into an infinite loop. Eeek. It turned out to be a genuine and long-standing bug in the occurrence analyer, specifically in the bit that identifies loop breakers. In this line pairs | isEmptyVarSet weak_fvs = reOrderNodes 0 bndr_set weak_fvs tagged_nodes [] | otherwise = loopBreakNodes 0 bndr_set weak_fvs loop_breaker_edges [] the 'tagged_nodes' should be 'loop_breaker_edges'. That's it! The diff looks a lot bigger because I did some work on comments and variable naming, but that's all it is. We were using the wrong set of dependencies! I'm astonished that this bug has not caused more trouble. It dates back to at least 2011 and maybe further.
* Be a bit more selective about improvementSimon Peyton Jones2016-11-252-6/+57
| | | | | | | | | This patch makes [W] constraints not participate in improvement. See Note [Do not do improvement for WOnly] in TcSMonad. Removes some senseless work duplication in some cases (notably Trac #12860); should not change behaviour.
* A tiny bit more tc tracingSimon Peyton Jones2016-11-251-1/+4
|
* Fix inference of partial signaturesSimon Peyton Jones2016-11-254-2/+51
| | | | | | | | | | | When we had f :: ( _ ) => blah we were failing to call growThetaTyVars, as we do in the no-type-signature case, and that meant that we weren't generalising over the right type variables. I'm quite surprised this didn't cause problems earlier. Anyway Trac #12844 showed it up and this patch fixes it
* Refactor functional dependencies a bitSimon Peyton Jones2016-11-256-88/+106
| | | | | | | | | | | | | | * Rename CoAxiom.Eqn = Pair Type to TypeEqn, and use it for fundeps * Use the FunDepEqn for injectivity, which lets us share a bit more code, and (more important) brain cells * When generating fundeps, take the max depth of the two constraints. This aimed at tackling the strange loop in Trac #12860, but there is more to come for that. * Improve pretty-printing with -ddump-tc-trace
* Improve pretty-printing of typesSimon Peyton Jones2016-11-256-23/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this commit commit 6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5 Author: Ben Gamari <bgamari.foss@gmail.com> Date: Sun Nov 13 16:17:37 2016 -0500 Kill Type pretty-printer we switched to pretty-printing a type by converting it to an IfaceType and pretty printing that. Very good. This patch fixes two things * The new story is terrible for debug-printing with -ddump-tc-trace, because all the extra info in an open type was discarded ty the conversion to IfaceType. This patch adds IfaceTcTyVar to IfaceType, to carry a TcTyVar in debug situations. Quite an easy change, happily. These things never show up in interface files. * Now that we are going via IfaceType, it's essential to tidy before converting; otherwise forall k_23 k_34. blah is printed as forall k k. blah which is very unhelpful. Again this only shows up in debug printing.
* Use TyVars in PatSynsSimon Peyton Jones2016-11-256-40/+28
| | | | | | | | | I found that some TcTyVars were lurking in a PatSyn, because tc_patsyn_finish was using the TcType -> TcType zonker rather than the TcType -> Type zonker. Eeek. I fixing this I also tided up function naming a bit (still not terrific), and removed the unused TcTyBinder type entirely.
* Use TyVars in a DFunUnfoldingSimon Peyton Jones2016-11-251-9/+15
| | | | | | | | | En route to something else I discovered that TcInstDcls.addDFunPrags was building a DFunUnfolding that had TcTyVars in it. They should never survive beyond type checking. It was harmeless, but now affects type pretty-printing. This patch fixes it.
* Use 'v' instead of 'tpl' for template varsSimon Peyton Jones2016-11-251-1/+1
| | | | | Just affects Id.mkTemplateLocal, and should make debug prints a little less voluminous. No user-visible change here.
* Kill off ifaceTyVarsOfTypeSimon Peyton Jones2016-11-251-69/+21
| | | | | | | | | | IfaceTypes are really not well suited to finding free variables etc. Nevertheless, there was quite a lot of code to do just that; but it was only used to see if a kind is variable-free so as to decide whether to print a forall binder. This patch simplifies to deal with just that case, replacing all the free-vars stuff with just ifTypeIsVarFree
* Test Trac #12845Simon Peyton Jones2016-11-253-0/+31
|
* Test Trac #12867Simon Peyton Jones2016-11-253-0/+23
|
* Fix a name-space problem with promotionSimon Peyton Jones2016-11-254-1/+43
| | | | | Trac #12686 showed that we were allowing a term variable into a type, by promotion. I chose to squash this in the renamer.
* Typos in commentsGabor Greif2016-11-252-2/+2
|
* Perf improvements in T6048, T10547Simon Peyton Jones2016-11-251-2/+6
| | | | | I think this wave of commits just made these two a little better; they must have been close to the threshold before.
* Remove redundant kind checkSimon Peyton Jones2016-11-251-2/+3
| | | | | The invariants for CTyEqCan mean that this check isn't needed. Turn it into an ASSERT.
* Allow TyVars in TcTypesSimon Peyton Jones2016-11-256-39/+76
| | | | | | | | | | | | | | | | | | | Up to now we've had a rule that a TyVar can't apppear in a type seen by the type checker; they should all be TcTyVars. But: a) With -XTypeInType it becomes much harder to exclude them; see Note [TcTyVars in the typechecker] in TcType. b) It's unnecessary to exculde them; instead we can just treat a TyVar just like vanillaSkolemTv. This is what was causing an ASSERT error in indexed-types/should_fail/T12041, reported in Trac #12826. That patch allows a TyVar in a TcType. The most significant change is to make Var.tcTyVarDetails return vanillaSkolemTv. In fact it already did, but (a) it was not documented, and (b) we never exploited it. Now we rely on it.
* Another major constraint-solver refactoringSimon Peyton Jones2016-11-2548-1609/+1882
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch takes further my refactoring of the constraint solver, which I've been doing over the last couple of months in consultation with Richard. It fixes a number of tricky bugs that made the constraint solver actually go into a loop, including Trac #12526 Trac #12444 Trac #12538 The main changes are these * Flatten unification variables (fmvs/fuvs) appear on the LHS of a tvar/tyvar equality; thus fmv ~ alpha and not alpha ~ fmv See Note [Put flatten unification variables on the left] in TcUnify. This is implemented by TcUnify.swapOverTyVars. * Don't reduce a "loopy" CFunEqCan where the fsk appears on the LHS: F t1 .. tn ~ fsk where 'fsk' is free in t1..tn. See Note [FunEq occurs-check principle] in TcInteract This neatly stops some infinite loops that people reported; and it allows us to delete some crufty code in reduce_top_fun_eq. And it appears to be no loss whatsoever. As well as fixing loops, ContextStack2 and T5837 both terminate when they didn't before. * Previously we generated "derived shadow" constraints from Wanteds, but we could (and sometimes did; Trac #xxxx) repeatedly generate a derived shadow from the same Wanted. A big change in this patch is to have two kinds of Wanteds: [WD] behaves like a pair of a Wanted and a Derived [W] behaves like a Wanted only See CtFlavour and ShadowInfo in TcRnTypes, and the ctev_nosh field of a Wanted. This turned out to be a lot simpler. A [WD] gets split into a [W] and a [D] in TcSMonad.maybeEmitShaodow. See TcSMonad Note [The improvement story and derived shadows] * Rather than have a separate inert_model in the InertCans, I've put the derived equalities back into inert_eqs. We weren't gaining anything from a separate field. * Previously we had a mode for the constraint solver in which it would more aggressively solve Derived constraints; it was used for simplifying the context of a 'deriving' clause, or a 'default' delcaration, for example. But the complexity wasn't worth it; now I just make proper Wanted constraints. See TcMType.cloneWC * Don't generate injectivity improvement for Givens; see Note [No FunEq improvement for Givens] in TcInteract * solveSimpleWanteds leaves the insolubles in-place rather than returning them. Simpler. I also did lots of work on comments, including fixing Trac #12821.
* Add elemDVarEnvSimon Peyton Jones2016-11-251-1/+4
| | | | I need this in a later patch
* Comments only in TcTypeSimon Peyton Jones2016-11-251-34/+38
|
* Fix a bug in mk_superclasses_ofSimon Peyton Jones2016-11-251-6/+12
| | | | | | | This bug meant that we were less eager about expanding tuple superclasses than we should have been; i.e. we stopped too soon. That's not fatal, beause we expand more superclasses later, but it's less efficient.
* Make a panic into an ASSERTSimon Peyton Jones2016-11-251-4/+2
|
* Make quoting and reification return the same typesDominik Bollmann2016-11-255-10/+89
| | | | | | | | | | | | | | | | | | Previously TH was incorrectly returning a `Dec` using a `ConT` instead of `PromotedT`. Test Plan: validate Reviewers: mainland, jstolarek, osa1, goldfire, thomie, bollmann, bgamari, RyanGlScott, austin Reviewed By: RyanGlScott Subscribers: erikd Differential Revision: https://phabricator.haskell.org/D2188 GHC Trac Issues: #11629
* Collect wildcards in sum types during renaming (#12711)Ömer Sinan Ağacan2016-11-244-2/+9
| | | | | | | | | | | | | | | | This patch also removes the "catch all" pattern in the function and explicitly lists constructors to get a warning in the future if a new `HsType` was added. Reviewers: bgamari, austin, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2753 GHC Trac Issues: #12711