| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This reduces duplication as well as fixes a bug wherein -dinlining-check
would override -ddump-inlinings. Moreover, the new variant
|
|
|
|
|
| |
It's been unused for a year and is problematic on any OS which
requires W^X for security.
|
|
|
|
|
|
|
| |
When specialising a DFun we must take care to saturate the
unfolding. See Note [Specialising DFuns] in Specialise.
Fixes #18120
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
It doesn't make sense to call the "free" variables we are about to
implicitly bind the real ones.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Add examples to Data.Bitraversable
* Fix formatting for (,) in Bitraversable and Bifoldable
* Fix mistake on bimapAccumR documentation
See #17929
|
|
|
|
| |
See #17929
|
|
|
|
|
| |
Avoid removing some functions that are part of an API even
though they're not used in-tree at the moment.
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
| |
Avoid direct use of DynFlags to know if symbols must be prefixed by an
underscore.
|
|
|
|
|
|
|
|
|
| |
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;
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
-------------------------
|
|
|
|
|
| |
In b3df9e780fb2f5658412c644849cd0f1e6f50331 I broke colorized messages
by using "dump" style instead of "user" style. This commits fixes it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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-key` which has been removed in 2016
(240ddd7c39536776e955e881d709bbb039b48513)
* remove support for `-this-package-key` which has been deprecated at the
same time
|
| |
|
|
|
|
| |
accordingly)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
| |
Previously this was not easily available to the user. Fix this.
Non-moving collection lifecycle events are now reported with -lg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
Use `withPprStyle` instead to apply a specific style to a SDoc.
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(cherry picked from commit 2fa79119570b358a4db61446396889b8260d7957)
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|