summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Avoid unnecessary allocations due to tracing utilitieswip/lower-tc-tracing-costBen Gamari2020-05-257-22/+80
| | | | | | | | | | | | | | | | | | | | While ticky-profiling the typechecker I noticed that hundreds of millions of SDocs are being allocated just in case -ddump-*-trace is enabled. This is awful. We avoid this by ensuring that the dump flag check is inlined into the call site, ensuring that the tracing document needn't be allocated unless it's actually needed. See Note [INLINE conditional tracing utilities] for details. Fixes #18168. Metric Decrease: T9961 haddock.Cabal haddock.base haddock.compiler
* GHC.Core.Unfold: Refactor traceInlineBen Gamari2020-05-091-9/+10
| | | | | This reduces duplication as well as fixes a bug wherein -dinlining-check would override -ddump-inlinings. Moreover, the new variant
* Remove unused SEGMENT_PROT_RWXGreg Steuck2020-05-081-2/+0
| | | | | It's been unused for a year and is problematic on any OS which requires W^X for security.
* Fix specialisation for DFunsSimon Peyton Jones2020-05-086-56/+111
| | | | | | | When specialising a DFun we must take care to saturate the unfolding. See Note [Specialising DFuns] in Specialise. Fixes #18120
* Reject all duplicate declarations involving DuplicateRecordFields (fixes #17965)Adam Gundry2020-05-085-6/+24
| | | | | | This fixes a bug that resulted in some programs being accepted that used the same identifier as a field label and another declaration, depending on the order they appeared in the source code.
* Apply more suggestions from Simon JakobiJoseph C. Sible2020-05-081-4/+4
|
* Apply suggestion to libraries/base/Data/Monoid.hsJoseph C. Sible2020-05-081-1/+1
|
* Document lawlessness of Ap's Num instanceJoseph C. Sible2020-05-081-0/+26
|
* Add `forAllOrNothing` function with noteJohn Ericson2020-05-083-31/+46
|
* A few tiny style nits with renamingJohn Ericson2020-05-082-9/+10
| | | | | | | | - Use case rather than guards that repeatedly scrutenize same thing. - No need for view pattern when `L` is fine. - Use type synnonym to convey the intent like elsewhere.
* Rename local `real_fvs` to `implicit_vs`John Ericson2020-05-081-4/+6
| | | | | It doesn't make sense to call the "free" variables we are about to implicitly bind the real ones.
* HsSigWcTypeScoping: Pull in documentation from stray locationJohn Ericson2020-05-081-14/+16
|
* Specify kind variables for inferred kinds in base.Baldur Blöndal2020-05-0821-140/+240
|
* doc (Bitraversable): Add examples to BitraversableJulien Debon2020-05-082-3/+68
| | | | | | | | * Add examples to Data.Bitraversable * Fix formatting for (,) in Bitraversable and Bifoldable * Fix mistake on bimapAccumR documentation See #17929
* Add doc examples for BifoldableJulien Debon2020-05-081-7/+581
| | | | See #17929
* Remove further dead code found by a simple Python script.Brian Foley2020-05-0813-192/+14
| | | | | Avoid removing some functions that are part of an API even though they're not used in-tree at the moment.
* Refactoring: Use bindSigTyVarsFV in rnMethodBindsRyan Scott2020-05-061-8/+1
| | | | | | | | | | | | `rnMethodBinds` was explicitly using `xoptM` to determine if `ScopedTypeVariables` is enabled before bringing type variables bound by the class/instance header into scope. However, this `xoptM` logic is already performed by the `bindSigTyVarsFV` function. This patch uses `bindSigTyVarsFV` in `rnMethodBinds` to reduce the number of places where we need to consult if `ScopedTypeVariables` is on. This is purely refactoring, and there should be no user-visible change in behavior.
* Don't use DynFlags in showLinkerState (#17957)Sylvain Henry2020-05-062-5/+7
|
* Move LeadingUnderscore into Platform (#17957)Sylvain Henry2020-05-066-17/+13
| | | | | Avoid direct use of DynFlags to know if symbols must be prefixed by an underscore.
* ELF linker: increment curSymbol after filling in fields of current entryÖmer Sinan Ağacan2020-05-061-1/+2
| | | | | | | | | The bug was introduced in a8b7cef4d45 which added a field to the `symbols` array elements and then updated this code incorrectly: - oc->symbols[curSymbol++] = nm; + oc->symbols[curSymbol++].name = nm; + oc->symbols[curSymbol].addr = symbol->addr;
* Make isTauTy detect higher-rank contextsRyan Scott2020-05-067-9/+91
| | | | | | | | | Previously, `isTauTy` would only detect higher-rank `forall`s, not higher-rank contexts, which led to some minor bugs observed in #18127. Easily fixed by adding a case for `(FunTy InvisArg _ _)`. Fixes #18127.
* Allow atomic update of NameCache in readHieFileZubin Duggal2020-05-064-25/+27
| | | | | | | | | | | The situation arises in ghcide where multiple different threads may need to update the name cache, therefore with the older interface it could happen that you start reading a hie file with name cache A and produce name cache A + B, but another thread in the meantime updated the namecache to A + C. Therefore if you write the new namecache you will lose the A' updates from the second thread. Updates haddock submodule
* nonmoving: Fix handling of dirty objectsBen Gamari2020-05-064-3/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we (incorrectly) relied on failed_to_evac to be "precise". That is, we expected it to only be true if *all* of an object's fields lived outside of the non-moving heap. However, does not match the behavior of failed_to_evac, which is true if *any* of the object's fields weren't promoted (meaning that some others *may* live in the non-moving heap). This is problematic as we skip the non-moving write barrier for dirty objects (which we can only safely do if *all* fields point outside of the non-moving heap). Clearly this arises due to a fundamental difference in the behavior expected of failed_to_evac in the moving and non-moving collector. e.g., in the moving collector it is always safe to conservatively say failed_to_evac=true whereas in the non-moving collector the safe value is false. This issue went unnoticed as I never wrote down the dirtiness invariant enforced by the non-moving collector. We now define this invariant as An object being marked as dirty implies that all of its fields are on the mark queue (or, equivalently, update remembered set). To maintain this invariant we teach nonmovingScavengeOne to push the fields of objects which we fail to evacuate to the update remembered set. This is a simple and reasonably cheap solution and avoids the complexity and fragility that other, more strict alternative invariants would require. All of this is described in a new Note, Note [Dirty flags in the non-moving collector] in NonMoving.c.
* nonmoving: Fix incorrect failed_to_evac value during deadlock gcBen Gamari2020-05-061-4/+3
| | | | | | | Previously we would incorrectly set the failed_to_evac flag if we evacuated a value due to a deadlock GC. This would cause us to mark more things as dirty than strictly necessary. It also turned up a nasty but which I will fix next.
* rts: Zero block flags with -DZBen Gamari2020-05-061-0/+12
| | | | | | | Block flags are very useful for determining the state of a block. However, some block allocator users don't touch them, leading to misleading values. Ensure that we zero then when zero-on-gc is set. This is safe and makes the flags more useful during debugging.
* Refactor hole constraints.Richard Eisenberg2020-05-0623-480/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, holes (both expression holes / out of scope variables and partial-type-signature wildcards) were emitted as *constraints* via the CHoleCan constructor. While this worked fine for error reporting, there was a fair amount of faff in keeping these constraints in line. In particular, and unlike other constraints, we could never change a CHoleCan to become CNonCanonical. In addition: * the "predicate" of a CHoleCan constraint was really the type of the hole, which is not a predicate at all * type-level holes (partial type signature wildcards) carried evidence, which was never used * tcNormalise (used in the pattern-match checker) had to create a hole constraint just to extract it again; it was quite messy The new approach is to record holes directly in WantedConstraints. It flows much more nicely now. Along the way, I did some cleaning up of commentary in GHC.Tc.Errors.Hole, which I had a hard time understanding. This was instigated by a future patch that will refactor the way predicates are handled. The fact that CHoleCan's "predicate" wasn't really a predicate is incompatible with that future patch. No test case, because this is meant to be purely internal. It turns out that this change improves the performance of the pattern-match checker, likely because fewer constraints are sloshing about in tcNormalise. I have not investigated deeply, but an improvement is not a surprise here: ------------------------- Metric Decrease: PmSeriesG -------------------------
* Fix colorized error messages (#18128)Sylvain Henry2020-05-051-1/+1
| | | | | In b3df9e780fb2f5658412c644849cd0f1e6f50331 I broke colorized messages by using "dump" style instead of "user" style. This commits fixes it.
* Add regression tests for #16244, #16245, #16758Ryan Scott2020-05-059-1/+55
| | | | | | | | | | | | | | | | | | Commit e3c374cc5bd7eb49649b9f507f9f7740697e3f70 ended up fixing quite a few bugs: * This commit fixes #16244 completely. A regression test has been added. * This commit fixes one program from #16245. (The program in https://gitlab.haskell.org/ghc/ghc/issues/16245#note_211369 still panics, and the program in https://gitlab.haskell.org/ghc/ghc/issues/16245#note_211400 still loops infinitely.) A regression test has been added for this program. * This commit fixes #16758. Accordingly, this patch removes the `expect_broken` label from the `T16758` test case, moves it from `should_compile` to `should_fail` (as it should produce an error message), and checks in the expected stderr.
* Fix Haskell98 short description in documentationDenisFrezzato2020-05-051-1/+1
|
* Remove SpecConstrAnnotation (#13681)Sylvain Henry2020-05-055-111/+30
| | | | | | | | | This has been deprecated since 2013. Use GHC.Types.SPEC instead. Make GHC.Exts "not-home" for haddock Metric Decrease: haddock.base
* Remove references to -package-keySylvain Henry2020-05-056-27/+10
| | | | | | | | * remove references to `-package-key` which has been removed in 2016 (240ddd7c39536776e955e881d709bbb039b48513) * remove support for `-this-package-key` which has been deprecated at the same time
* Remove unused hs-boot filejneira2020-05-041-6/+0
|
* Remove custom ExceptionMonad class (#18075) (updating haddock submodule ↵Artem Pelenitsyn2020-05-0430-227/+118
| | | | accordingly)
* Don't require parentheses around via type (`-XDerivingVia'). Fixes #18130".Baldur Blöndal2020-05-046-2/+48
|
* Don't return a panic in tcNestedSpliceSimon Peyton Jones2020-05-044-16/+27
| | | | | | | | | | | | | In GHC.Tc.Gen.Splice.tcNestedSplice we were returning a typechecked expression of "panic". That is usually OK, because the result is discarded. But it happens that tcApp now looks at the typechecked expression, trivially, to ask if it is tagToEnum. So being bottom is bad. Moreover a debug-trace might print it out. So better to return a civilised expression, even though it is usually discarded.
* Flatten nested casts in the simple optimizerAlexis King2020-05-034-5/+23
| | | | | | | | | | Normally, we aren’t supposed to generated any nested casts, since mkCast takes care to flatten them, but the simple optimizer didn’t use mkCast, so they could show up after inlining. This isn’t really a problem, since the simplifier will clean them up immediately anyway, but it can clutter the -ddump-ds output, and it’s an extremely easy fix. closes #18112
* users guide: Add documentation for non-moving GC eventsBen Gamari2020-05-031-0/+79
|
* users guide: Move eventlog documentation users guideBen Gamari2020-05-034-104/+585
|
* rts: Enable tracing of nonmoving heap census with -lnBen Gamari2020-05-033-0/+9
| | | | | Previously this was not easily available to the user. Fix this. Non-moving collection lifecycle events are now reported with -lg.
* PmCheck: Pick up `EvVar`s bound in `HsWrapper`s for long-distance infoSebastian Graf2020-05-016-32/+95
| | | | | | | | | | | | | | | | | | | | `HsWrapper`s introduce evidence bindings through `WpEvLam` which the pattern-match coverage checker should be made aware of. Failing to do so caused #18049, where the resulting impreciseness of imcompleteness warnings seemingly contradicted with `-Winaccessible-code`. The solution is simple: Collect all the evidence binders of an `HsWrapper` and add it to the ambient `Deltas` before desugaring the wrapped expression. But that means we pick up many more evidence bindings, even when they wrap around code without a single pattern match to check! That regressed `T3064` by over 300%, so now we are adding long-distance info lazily through judicious use of `unsafeInterleaveIO`. Fixes #18049.
* PmCheck: Only call checkSingle if we would report warningsSebastian Graf2020-05-011-2/+4
|
* Fully remove PprDebugSylvain Henry2020-05-0113-94/+102
| | | | | | | PprDebug was a pain to deal with consistently as it is implied by `-dppr-debug` but it isn't really a PprStyle. We remove it completely and query the appropriate SDoc flag instead (`sdocPprDebug`) via helpers (`getPprDebug` and its friends).
* Remove PprStyle param of logging actionsSylvain Henry2020-05-0119-82/+80
| | | | Use `withPprStyle` instead to apply a specific style to a SDoc.
* Refactor PprDebug handlingSylvain Henry2020-05-0124-81/+73
| | | | | | | | | | | If `-dppr-debug` is set, then PprUser and PprDump styles are silently replaced with PprDebug style. This was done in `mkUserStyle` and `mkDumpStyle` smart constructors. As a consequence they needed a DynFlags parameter. Now we keep the original PprUser and PprDump styles until they are used to create an `SDocContext`. I.e. the substitution is only performed in `initSDocContext`.
* Use platform in Iface BinarySylvain Henry2020-05-011-10/+13
|
* GHC.StgToCmm.Ticky: remove a few unused stuffÖmer Sinan Ağacan2020-04-301-17/+4
|
* Remove OneShotInfo field of LFReEntrant, document OneShotInfoÖmer Sinan Ağacan2020-04-304-50/+106
| | | | | | | | | | | The field is only used in withNewTickyCounterFun and it's easier to directly pass a parameter for one-shot info to withNewTickyCounterFun instead of passing it via LFReEntrant. This also makes !2842 simpler. Other changes: - New Note (by SPJ) [OneShotInfo overview] added. - Arity argument of thunkCode removed as it's always 0.
* nonmoving: Eagerly flush all capabilities' update remembered setsBen Gamari2020-04-301-2/+4
| | | | (cherry picked from commit 2fa79119570b358a4db61446396889b8260d7957)
* nonmoving: Explicitly memoize block countBen Gamari2020-04-301-3/+2
| | | | | | A profile cast doubt on whether the compiler hoisted the bound out the loop as I would have expected here. It turns out it did but nevertheless it seems clearer to just do this manually.
* nonmoving: Clear bitmap after initializing block sizeBen Gamari2020-04-301-1/+1
| | | | | | | Previously nonmovingInitSegment would clear the bitmap before initializing the segment's block size. This is broken since nonmovingClearBitmap looks at the segment's block size to determine how much bitmap to clear.