| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
pprUserSpan, isZeroWidthSpan, pprLocated, combineRealSrcSpans
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using -fdicts-strict we generate references to absentError while
compiling ghc-prim. However we always load ghc-prim before base so this
caused linker errors.
We simply solve this by moving absentError into ghc-prim. This does mean
it's now a panic instead of an exception which can no longer be caught.
But given that it should only be thrown if there is a compiler error
that seems acceptable, and in fact we already do this for
absentSumFieldError which has similar constraints.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'Stream' is implemented in the "yoneda" style for efficiency. By
representing a stream in this manner 'fmap' and '>>=' operations are
accumulated in the function parameters before being applied once when
the stream is destroyed. In the old implementation each usage of 'mapM'
and '>>=' would traverse the entire stream in order to apply the
substitution at the leaves. It is well-known for free monads that this
representation can improve performance, and the test results
demonstrate this for GHC as well.
The operation mapAccumL is not used in the compiler and can't be
implemented efficiently because it requires destroying and rebuilding
the stream.
I removed one use of mapAccumL_ which has similar problems but the other
use was difficult to remove. In the future it may be worth exploring
whether the 'Stream' encoding could be modified further to capture the
mapAccumL pattern, and likewise defer the passing of accumulation
parameter until the stream is finally consumed.
The >>= operation for 'Stream' was a hot-spot in the ticky profile for
the "ManyConstructors" test which called the 'cg' function many times in
"StgToCmm.hs"
Metric Decrease:
ManyConstructors
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was revealed in #19363 that the Template Haskell pretty-printer implemented
in `Language.Haskell.TH.Ppr` did not pretty-print infix names or symbolic names
correctly in certain situations, such as in data constructor declarations or
fixity declarations. Easily fixed by using `pprName' Applied` (which always
parenthesizes symbolic names in prefix position) or `pprName' Infix` (which
always surrounds alphanumeric names with backticks in infix position) in the
right spots.
Fixes #19363.
|
|
|
|
|
|
| |
Fixes #18966. Adds a new warning -Wambiguous-fields for uses of field selectors
or record updates that will be rejected in the future, when the DuplicateRecordFields
extension is simplified per https://github.com/ghc-proposals/ghc-proposals/pull/366.
|
|
|
|
|
|
|
|
|
| |
Update the documentation to specify that MonoLocalBinds is lifted
by a partial type signature.
This came up in #19396.
[skip ci]
|
|
|
|
|
|
|
| |
With this patch, everything built by the stage1 compiler (in a
`ticky_ghc`-transformed flavour) will be built with `-ticky`.
Fixes #19405.
|
|
|
|
|
|
|
|
|
| |
When desugaring ApplicativeDo, GHC looks up the name `fmap`, not `<$>`
(see 'GHC.Builtin.Names.fmapName'). This commit fixes the misleading
documentation; since exporting the name `<$>` instead of `fmap` causes a
"not in scope" error when `QualifiedDo` and `ApplicativeDo` is combined.
[skip ci]
|
|
|
|
| |
Due to #19025.
|
| |
|
| |
|
|
|
|
| |
Needed by #19025.
|
|
|
|
| |
This reverts commit 4a9d856d21c67b3328e26aa68a071ec9a824a7bb.
|
| |
|
| |
|
|
|
|
|
| |
It makes the external package state independent of the home unit which
is needed to make several home units share the EPS.
|
|
|
|
|
|
| |
alignment clearly should be a power of two. This patch makes it
so. We do so by using the #alignment directive instead of using
the size of the type.
|
| |
|
|
|
|
|
| |
As noted in #18391, foreignInterruptible fails pretty regularly under
GHCi.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before the change the error did not show details of involved module:
```
haddock: panic! (the 'impossible' happened)
(GHC version 8.10.3:
ModOrigin: hidden module redefined
```
After the change modile details are shown:
```
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 9.1.20210206:
ModOrigin: package both exposed/hidden
x: exposed package
y: reexport by ghc-boot-9.1
```
Fixes #19330
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
| |
|
|
|
|
| |
The COMPLETE pragma was not properly terminated with a '#-}'.
|
|
|
|
|
| |
This was observed to build up thunks which were forced by using
a `-hi` profile and T3294 as a test.
|
|
|
|
|
| |
This value is eventually forced so don't build up thunks.
Observed with T3294 and -hi profile.
|
|
|
|
|
|
| |
I observed this accumulating in the T3294 test only to be eventually
forced (by a -hi profile). As it is only word big, forcing it saves quite a bit of
allocation.
|
|
|
|
| |
This is a well known technique to reduce inter-CPU bus traffic while waiting for the lock by reducing the number of writes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to only show the fixity of an operator if it wasn't the default
fixity. Usually this was when the fixity was undeclared, but it could
also arise if one declared the fixity of an operator as infixl 9, the
default fixity. This commit makes it so that :i always shows the fixity
of an operator, even if it is unset.
We may want in the future to keep track of whether an operator's fixity
is defined, so that we can print a comment like
infixl 9 # -- Assumed, since no fixity is declared.
for operators with no specified fixity, and so that we can print fixity
of a term with a non-symbolic term when its fixity has been manually
specified as infixl 9.
Implements #19200.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* `openFile` could sometimes leak file descriptors if it
received an asynchronous exception (#19114, #19115). Fix this
on POSIX.
* `openFile` and more importantly `openFileBlocking` could not
be interrupted effectively during the `open` system call (#17912).
Fix this on POSIX.
* Implement `readFile'` using `withFile` to ensure the file is closed promptly on exception.
* Avoid `bracket` in `withFile`, reducing the duration of masking.
Closes #19130.
Addresses #17912, #19114, and #19115 on POSIX systems, but not
on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When implementing Quick Look I'd failed to remember that overloaded
labels, like #foo, should be treated as a "head", so that they can be
instantiated with Visible Type Application. This caused #19154.
A very similar ticket covers overloaded literals: #19167.
This patch fixes both problems, but (annoyingly, albeit temporarily)
in two different ways.
Overloaded labels
I dealt with overloaded labels by buying fully into the
Rebindable Syntax approach described in GHC.Hs.Expr
Note [Rebindable syntax and HsExpansion].
There is a good overview in GHC.Rename.Expr
Note [Handling overloaded and rebindable constructs].
That module contains much of the payload for this patch.
Specifically:
* Overloaded labels are expanded in the renamer, fixing #19154.
See Note [Overloaded labels] in GHC.Rename.Expr.
* Left and right sections used to have special code paths in the
typechecker and desugarer. Now we just expand them in the
renamer. This is harder than it sounds. See GHC.Rename.Expr
Note [Left and right sections].
* Infix operator applications are expanded in the typechecker,
specifically in GHC.Tc.Gen.App.splitHsApps. See
Note [Desugar OpApp in the typechecker] in that module
* ExplicitLists are expanded in the renamer, when (and only when)
OverloadedLists is on.
* HsIf is expanded in the renamer when (and only when) RebindableSyntax
is on. Reason: the coverage checker treats HsIf specially. Maybe
we could instead expand it unconditionally, and fix up the coverage
checker, but I did not attempt that.
Overloaded literals
Overloaded literals, like numbers (3, 4.2) and strings with
OverloadedStrings, were not working correctly with explicit type
applications (see #19167). Ideally I'd also expand them in the
renamer, like the stuff above, but I drew back on that because they
can occur in HsPat as well, and I did not want to to do the HsExpanded
thing for patterns.
But they *can* now be the "head" of an application in the typechecker,
and hence something like ("foo" @T) works now. See
GHC.Tc.Gen.Head.tcInferOverLit. It's also done a bit more elegantly,
rather than by constructing a new HsExpr and re-invoking the
typechecker. There is some refactoring around tcShortCutLit.
Ultimately there is more to do here, following the Rebindable Syntax
story.
There are a lot of knock-on effects:
* HsOverLabel and ExplicitList no longer need funny (Maybe SyntaxExpr)
fields to support rebindable syntax -- good!
* HsOverLabel, OpApp, SectionL, SectionR all become impossible in the
output of the typecheker, GhcTc; so we set their extension fields to
Void. See GHC.Hs.Expr Note [Constructor cannot occur]
* Template Haskell quotes for HsExpanded is a bit tricky. See
Note [Quotation and rebindable syntax] in GHC.HsToCore.Quote.
* In GHC.HsToCore.Match.viewLExprEq, which groups equal HsExprs for the
purpose of pattern-match overlap checking, I found that dictionary
evidence for the same type could have two different names. Easily
fixed by comparing types not names.
* I did quite a bit of annoying fiddling around in GHC.Tc.Gen.Head and
GHC.Tc.Gen.App to get error message locations and contexts right,
esp in splitHsApps, and the HsExprArg type. Tiresome and not very
illuminating. But at least the tricky, higher order, Rebuilder
function is gone.
* Some refactoring in GHC.Tc.Utils.Monad around contexts and locations
for rebindable syntax.
* Incidentally fixes #19346, because we now print renamed, rather than
typechecked, syntax in error mesages about applications.
The commit removes the vestigial module GHC.Builtin.RebindableNames,
and thus triggers a 2.4% metric decrease for test MultiLayerModules
(#19293).
Metric Decrease:
MultiLayerModules
T12545
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than just display every 100 tests, work out how many to display
based on the total number of tests. This improves the experience when
running a small number of tests.
For [0..100] - Report every test
[100..1000] - Report every 10 tests
[1000..10000] - Report every 100 tests
and so on..
|
|
|
|
| |
Fixes #19122.
|
|
|
|
|
|
|
| |
As pointed in #19284, previously the order was a bit confusing.
This didn't affect the meaning but nevertheless it's much clearer now.
Closes #19284.
|
|
|
|
| |
closes #19365
|
| |
|
|
|
|
| |
And also for empty enumeration detection.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At a SPECIALSE pragma for an imported Id, we used to check that
it was marked INLINABLE. But that turns out to interact badly with
worker/wrapper: see Note [Worker-wrapper for INLINABLE functions] in
GHC.Core.Opt.WorkWrap.
So this small patch instead simply tests that we have an unfolding
for the function; see Note [SPECIALISE pragmas for imported Ids]
in GHC.Tc.Gen.Sig.
Fixes #19246
|
|
|
|
|
|
| |
This allows TypeMap to benefit from the nullary TyConApp sharing
optimisation described in Note [Sharing nullary TyConApps] in
GHC.Core.TyCon.
|
|
|
|
|
|
|
|
|
|
|
| |
See Note [Sharing nullary TyConApps] in GHC.Core.TyCon.
Closes #19367.
Metric Decrease:
T9872a
T9872b
T9872c
|
|
|
|
|
|
|
|
|
| |
This function is exposed in the RtsAPI.h so that external users have a
blessed way to traverse all the different `bdescr`s which are known by
the RTS.
The main motivation is to use this function in ghc-debug but avoid
having to expose the internal structure of a Capability in the API.
|
| |
|
|
|
|
|
|
| |
In a new `Note [Bottom CPR iff Dead-Ending Divergence]`.
Fixes #18086.
|
|
|
|
|
|
|
|
|
|
| |
Previously, the desugarer was looking up names referenced in TH-quoted `ANN`s
by using `globalVar`, which would allocate a fresh TH `Name`. In effect, this
would prevent quoted `ANN`s from ever referencing the correct identifier
`Name`, leading to #19377. The fix is simple: instead of `globalVar`, use
`lookupLOcc`, which properly looks up the name of the in-scope identifier.
Fixes #19377.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a redesign of the UnVarGraph data structure used by the call
arity analysis to avoid the pathologically-poor performance observed in
issue #18789. Specifically, deletions were previously O(n) in the case
of graphs consisting of many complete (bipartite) sub-graphs. Together
with the nature of call arity this would produce quadratic behavior.
We now encode deletions specifically, taking care to do some light
normalization of empty structures. In the case of the
`Network.AWS.EC2.Types.Sum` module from #19203, this brings the
runtime of the call-arity analysis from over 50 seconds down to less
than 2 seconds.
Metric Decrease:
T15164
WWRec
|
| |
|
|
|
|
| |
Fixes #19118
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simon's concern in the old comment, specifically:
So all of the calls to traverseMaybeInitClosureData() here are
initialising retainer sets with the wrong flip.
Is actually exactly what the code was intended to do. It makes the closure
data valid, then at the beginning of the traversal the flip bit is flipped
resetting all closures across the heap to invalid.
Now it used to be that the profiling code using the traversal has it's own
sense of valid vs. invalid beyond what the traversal code does and indeed
the retainer profiler still does this, there a getClosureData of NULL is
considered an invalid retainer set.
So in effect there wasn't any difference in invalidating closure data
rather than just resetting it to a valid zero, which might be what confused
Simon at the time.
As the code is now it actually uses the value of the valid/invalid bit in
the form of the 'first_visit' argument to the 'visit' callback so there is
a difference.
|