| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`LIBRARY_PATH` is used to find libraries and other link artifacts while
`LD_LIBRARY_PATH` is used to find shared libraries by the loader.
Due to an implementation detail on Windows, using `LIBRARY_PATH` will
automatically add the path of any library found to the loader's path.
So in that case `LD_LIBRARY_PATH` won't be needed.
Test Plan:
./validate along with T14611 which has been made Windows only
due to linux using the system linker/loader by default. So I feel a
testcase there is unwarranted as the support is indirect via glibc.
Reviewers: hvr, bgamari, erikd, simonmar, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, thomie, carter
GHC Trac Issues: #14611
Differential Revision: https://phabricator.haskell.org/D4275
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Distinguishing between "refutable" and "irrefutable" patterns
(as described by the Haskell Report) in incomplete pattern errors
was more confusing than helpful. Remove references to irrefutable
patterns.
Reviewers: hvr, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #14569
Differential Revision: https://phabricator.haskell.org/D4261
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4256
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for adding Haddocks on individual non-record fields
of regular (and GADT) constructors. The following now parses just fine
with `-haddock` enabled:
data Foo
= Baz -- ^ doc on the `Baz` constructor
Int -- ^ doc on the `Int` field of `Baz`
String -- ^ doc on the `String` field of `Baz`
| Int -- ^ doc on the `Int` field of the `:*` constructor
:* -- ^ doc on the `:*` constructor
String -- ^ doc on the `String` field of the `:*`
constructor
| Boa -- ^ doc on the `Boa` record constructor
{ y :: () }
The change is backwards compatible: if there is only one doc and it
occurs
on the last field, it is lifted to apply to the whole constructor (as
before).
Reviewers: bgamari, alanz
Subscribers: rwbarton, thomie, mpickering, carter
Differential Revision: https://phabricator.haskell.org/D4292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, for each constructor that we want
to allocate a tag for we would traverse a list of all
the constructors in a datatype to determine which tag
a constructor should get.
This is obviously quadratic and for datatypes with 10k
constructors it actually makes a big difference.
This change implements the plan outlined by @simonpj in
https://mail.haskell.org/pipermail/ghc-devs/2017-October/014974.html
which is basically about using a map and constructing it outside the
loop.
One place where things got a bit awkward was TysWiredIn.hs,
it would have been possible to just assign the tags by hand, but
that seemed error-prone to me, so I decided to go through a map
there as well.
Test Plan:
./validate
On a file with 10k constructors
Before:
8,130,522,344 bytes allocated in the heap
Total time 3.682s ( 3.920s elapsed)
After:
4,133,478,744 bytes allocated in the heap
Total time 2.509s ( 2.750s elapsed)
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: goldfire, rwbarton, thomie, simonmar, carter, simonpj
GHC Trac Issues: #14657
Differential Revision: https://phabricator.haskell.org/D4289
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were shown up by Trac #14643
Bug 1: if we had a single partial signature for
two functions
f, g :: forall a. _ -> a
then we made two different SigTvs but with the sane Name.
This was jolly confusing and ultimately led to deeply bogus
results with Any's appearing in the resulting program. Yikes.
Fix: clone the quantified variables in TcSigs.tcInstSig (as
indeed its name suggests).
Bug 2: we were not eliminating duplicate/superclass constraints
in the partial signatures of a mutually recursive group.
Easy to fix: we are already doing dup/superclass elim in
TcSimplify.decideQuantification. So we move the partial-sig
constraints there too.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch moves the "ok_unfolding" test
from CoreOpt.joinPointBinding_maybe
to OccurAnal.decideJoinPointHood
Previously the occurrence analyser was deciding to make
something a join point, but the simplifier was reversing
that decision, which made the decision about /other/ bindings
invalid.
Fixes Trac #14650.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
get/setAllocationCounter didn't take into account allocations in the
current block. This was known at the time, but it turns out to be
important to have more accuracy when using these in a fine-grained
way.
Test Plan:
New unit test to test incrementally larger allocaitons. Before I got
results like this:
```
+0
+0
+0
+0
+0
+4096
+0
+0
+0
+0
+0
+4064
+0
+0
+4088
+4056
+0
+0
+0
+4088
+4096
+4056
+4096
```
Notice how the results aren't always monotonically increasing. After
this patch:
```
+344
+416
+488
+560
+632
+704
+776
+848
+920
+992
+1064
+1136
+1208
+1280
+1352
+1424
+1496
+1568
+1640
+1712
+1784
+1856
+1928
+2000
+2072
+2144
```
Reviewers: niteria, bgamari, hvr, erikd
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4288
|
|
|
|
|
|
|
|
|
| |
This one, discovered by Iceland Jack (Trac #14507), shows
that a pattern-bound coercion can show up in the argument
type(s) of the matcher of a pattern synonym.
The error message isn't great, but at least we now rightly
reject the program.
|
|
|
|
| |
Just better layout in output for the user
|
|
|
|
|
|
|
|
| |
Trac #14552 showed a very obscure case where we can't infer a
good pattern-synonym type.
The error message is horrible, but at least we no longer crash
and burn.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #13032 pointed out that we sometimes generate unused
bindings for Givens, and (worse still) we can't always discard
them later (we don't drop a case binding unless we can prove
that the scrutinee is non-bottom.
It looks as if this may be a major reason for the performace
problems in #14338 (see comment:29).
This patch fixes the problem at source, by pruning away all the
dead Givens. See Note [Delete dead Given evidence bindings]
Remarkably, compiler allocation falls by 23% in
perf/compiler/T12227!
I have not confirmed whether this change actualy helps with
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`GeneralizedNewtypeDeriving` generates calls to `coerce`
which take visible type arguments. These types must be produced by
way of `typeToLHsType`, which converts a `Type` to an `LHsType`.
However, `typeToLHsType` was leaving off important kind information
when a `Type` contained a poly-kinded tycon application, leading to
incorrectly generated code in #14579.
This fixes the issue by tweaking `typeToLHsType` to generate
explicit kind signatures for tycon applications. This makes the
generated code noisier, but at least the program from #14579 now
works correctly.
Test Plan: make test TEST=T14579
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14579
Differential Revision: https://phabricator.haskell.org/D4264
|
|
|
|
|
|
|
| |
As Trac #14605 showed, we can't defer a type error under a
'forall' (when unifying two forall types).
The fix is simple.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See Trac #14626, comment:4. We want to maintain evaluted-ness
info on Ids into the code generateor for two reasons
(see Note [Preserve evaluated-ness in CorePrep] in CorePrep)
- DataToTag magic
- Potentially using it in the codegen (this is Gabor's
current work)
But it was all being done very inconsistently, and actually
outright wrong -- the DataToTag magic hasn't been working for
years.
This patch tidies it all up, with Notes to match.
|
|
|
|
|
|
|
|
|
|
| |
In the presence of -fdefer-type-errors, OptCoercion can
encounter a mal-formed coerercion with type
T a ~ T a b
and that was causing a subsequent Lint error.
This caused Trac #14607. Easily fixed by turning an ASSERT
into a guard.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are record selectors.
To the unfamiliar, when inspecting core, they looked like data
constructors as they started with an upper case letter. We rename them
so that it is more clear that firstly they are functions and secondly
that they are selectors.
Reviewers: bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4280
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 714bebff44076061d0a719c4eda2cfd213b7ac3d removed
a check in the bytecode compiler that caught illegal uses of unboxed
tuples (and now sums) in case alternatives, which causes the program
in #14608 to panic. This restores the check (using modern,
levity-polymorphic vocabulary).
Test Plan: make test TEST=T14608
Reviewers: hvr, bgamari, dfeuer, simonpj
Reviewed By: dfeuer, simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #14608
Differential Revision: https://phabricator.haskell.org/D4276
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the testsuite pass clean on Windows again.
It also fixes the `libstdc++-6.dll` error harbormaster
was showing.
I'm marking some tests as isolated tests to reduce their
flakiness (mostly concurrency tests) when the test system
is under heavy load.
Updates process submodule.
Test Plan: ./validate
Reviewers: hvr, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4277
|
|
|
|
|
|
|
|
|
| |
Previously, we were inexplicably not applying an instantiating
substitution to arguments in non-prenex types. It's amazing this
has been around for so long! I guess there aren't a lot of non-prenex
types around.
test case: typecheck/should_fail/T14618
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This rather subtle patch fixes Trac #14584. The problem was
that we'd allowed a coercion, bound in a nested scope, to escape
into an outer scope.
The main changes are
* TcSimplify.floatEqualities takes more care when floating
equalities to make sure we don't float one out that mentions
a locally-bound coercion.
See Note [What prevents a constraint from floating]
* TcSimplify.emitResidualConstraints (which emits the residual
constraints in simplifyInfer) now avoids burying the constraints
for escaping CoVars inside the implication constraint.
* Since I had do to this stuff with CoVars, I moved the
fancy footwork about not quantifying over CoVars from
TcMType.quantifyTyVars to its caller
TcSimplify.decideQuantifiedTyVars. I think its other
callers don't need to worry about all this CoVar stuff.
This turned out to be surprisigly tricky, and took me a solid
day to get right. I think the result is reasonably neat, though,
and well documented with Notes.
|
|
|
|
|
|
|
| |
This fixes Trac #14479. Not difficult.
See Note [Quantification and partial signatures] Wrinkle 4,
in TcSimplify.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, GHC was pretty-printing left-section holes
incorrectly and not parsing right-sectioned holes at all. This patch
fixes both problems.
Test Plan: make test TEST=T14590
Reviewers: bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, mpickering, carter
GHC Trac Issues: #14590
Differential Revision: https://phabricator.haskell.org/D4273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, I added an ad hoc check for unboxed tuples and
sums in standalone-derived instances to fix #12512, under the
pretense that polymorphism over `UnboxedTupleRep` and
`UnboxedSumRep` was a lie. But that is no longer the case, and so
this ad hoc check can be removed entirely. Less code, and easier to
understand.
Test Plan: make test TEST=T12512
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4271
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Commit 372995364c52eef15066132d7d1ea8b6760034e6
inadvertently removed a check in the parser which rejected
let-bindings with bang patterns, leading to #14588. This fixes it by
creating a `hintBangPat` function to perform this check, and
sprinkling it in the right places.
Test Plan: make test TEST=T14588
Reviewers: bgamari, alanz, simonpj
Reviewed By: bgamari, simonpj
Subscribers: rwbarton, thomie, mpickering, carter
GHC Trac Issues: #14588
Differential Revision: https://phabricator.haskell.org/D4270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The `HsType` pretty-printer does not automatically insert
parentheses where necessary for type applications, so a function
`isCompoundHsType` was created in D4056 towards this purpose.
However, it was not used in as many places as it ought to be,
resulting in #14578.
Test Plan: make test TEST=T14578
Reviewers: alanz, bgamari, simonpj
Reviewed By: alanz, simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #14578
Differential Revision: https://phabricator.haskell.org/D4266
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: bgamari, niteria, erikd, dfeuer
Reviewed By: dfeuer
Subscribers: Yuras, dfeuer, rwbarton, thomie, carter
GHC Trac Issues: #14497
Differential Revision: https://phabricator.haskell.org/D4254
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #14998, where we eventually decided that
the existential type variables of the signature of a pattern
synonym should not scope over the pattern synonym.
See Note [Pattern synonym existentials do not scope] in TcPatSyn.
|
|
|
|
|
|
| |
This fixes Trac #14591
I took the opportunity to delete the dead code isMonadCompExpr
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes an outright bug in tcDataKindSig, shown up in Trac
of a data type declaration. See Note [TyConBinders for the result kind
signature of a data type]
I also took the opportunity to elminate the DataKindCheck argument
and data type from tcDataKindSig, instead moving the check to the
call site, which is easier to understand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We filter the complete patterns given in a COMPLETE set to only those that
subsume the type we are matching. Otherwise we end up introducing an ill-typed
equation into the overlap checking, provoking a crash. This was the cause of
Trac #14135.
Reviewers: austin, bgamari, mpickering, gkaracha, simonpj, RyanGlScott,
carlostome
Reviewed By: bgamari
Subscribers: carter, dfeuer, RyanGlScott, goldfire, rwbarton, thomie
GHC Trac Issues: #14135
Differential Revision: https://phabricator.haskell.org/D3981
|
|
|
|
|
|
|
|
|
| |
Trac #14554 showed up an outright bug in the unflattening code in
TcFlatten. I was filling in a coercion with the wrong coercion (a Syn
in the wrong place). Result: "Bad coercion hole" assertion failures,
and Core Lint Errors.
Easily fixed, and the code is simpler too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The typechecker has the invariant that every type should be well-kinded
as it stands, without zonking. See Note [The well-kinded type invariant]
in TcType.
That invariant was not being upheld, which led to Trac #14174. I fixed
part of it, but T14174a showed that there was more. This patch finishes
the job.
* See Note [The tcType invariant] in TcHsType, which articulates an
invariant that was very nearly, but not quite, true. One place that
falisified it was the HsWildCardTy case of tc_hs_type, so I fixed that.
* mkNakedCastTy now makes no attempt to eliminate casts; indeed it cannot
lest it break Note [The well-kinded type invariant]. The prior comment
suggested that it was crucial for performance but happily it seems not
to be. The extra Refls are eliminated by the zonker.
* I found I could tidy up TcHsType.instantiateTyN and instantiateTyUntilN
by eliminating one of its parameters. That led to a cascade of minor
improvements in TcTyClsDecls. Hooray.
|
|
|
|
|
|
|
|
| |
Bytes allocated has fallen by around 5%. I think this due
to some of my recent refactoring of the typechecker, but
I'm not certain about exactly which change did it.
Good though!
|
| |
|
|
|
|
|
|
|
|
| |
This bug was shown up by Trac #14561. The deguarer carefully
detects unsaturated and levity-polymorphic uses of primops,
but not of things like unsafeCoerce#.
The fix is simple: see Note [Levity-polymorphic Ids] in Id.
|
|
|
|
|
|
|
|
| |
This adds a regression test for the original program in #14040.
This does not fix #14040 entirely, though, as the program in
https://ghc.haskell.org/trac/ghc/ticket/14040#comment:2 still
panics, so there is more work to be done there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a new flag, `-fignore-optim-changes`, allowing them to avoid
recompilation if the only changes are to the `-O` level or to
flags controlling optimizations.
* When `-fignore-optim-changes` is *off*, recompile when optimization
flags (e.g., `-fno-full-laziness`) change. Previously, we ignored
these unconditionally when deciding whether to recompile a module.
Reviewers: austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: duog, carter, simonmar, rwbarton, thomie
GHC Trac Issues: #13604
Differential Revision: https://phabricator.haskell.org/D4123
|
|
|
|
|
|
| |
Because in recent RHEL7 suddenly locales like `bokmål` pop up, which
screw up reading-in of ASCII strings a line later. This additional
criterion reliably eliminates those unicode characters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes two bugs in the treatment of SigTvs at the
kind level:
- We should always generalise them, never default them
(Trac #14555, #14563)
- We should check if they get unified with each other
(Trac #11203)
Both are described in TcHsType
Note [Kind generalisation and SigTvs]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During type inference, we maintain the invariant that every type is
well-kinded /without/ zonking; and in particular that typeKind does
not fail (as it can for ill-kinded types).
But TcHsType.tcInferApps was not guaranteeing this invariant,
resulting in Trac #14174 and #14520.
This patch fixes it, making things better -- but it does /not/
fix the program in Trac #14174 comment:5, which still crashes.
So more work to be done.
See Note [Ensure well-kinded types] in TcHsType
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch refactors HsDecls.ConDecl. Specifically
* ConDeclGADT was horrible, with all the information hidden
inside con_res_ty. Now it's kept separate, as it should be.
* ConDeclH98: use [LHsTyVarBndr] instead of LHsQTyVars for the
existentials. There is no implicit binding here.
* Add a field con_forall to both ConDeclGADT and ConDeclH98
which says if there is an explicit user-written forall.
* Field renamings in ConDecl
con_cxt to con_mb_cxt
con_details to con_args
There is an accompanying submodule update to Haddock.
Also the following change turned out to remove a lot of clutter:
* add a smart constructor for HsAppsTy, namely mkHsAppsTy,
and use it consistently. This avoids a lot of painful pattern
matching for the common singleton case.
Two api-annotation tests (T10278, and T10399) are broken, hence marking
them as expect_broken(14529). Alan is going to fix them, probably by
changing the con_forall field to
con_forall :: Maybe SrcSpan
instead of Bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cache `TypeRep k` in each `TrApp` or `TrTyCon` constructor of
`TypeRep (a :: k)`. This makes `typeRepKind` cheap.
With this change, we won't need any special effort to deserialize
typereps efficiently. The downside, of course, is that we make
`TypeRep`s slightly larger.
Reviewers: austin, hvr, bgamari, simonpj
Reviewed By: bgamari, simonpj
Subscribers: carter, simonpj, rwbarton, thomie
GHC Trac Issues: #14254
Differential Revision: https://phabricator.haskell.org/D4085
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we attempted to lookup 'hole' packages for
include directories; this obviously is not going to work.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate
Reviewers: ekmett, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #14525
Differential Revision: https://phabricator.haskell.org/D4234
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Suppose that you are typechecking A.hs, which transitively imports,
via B.hs, A.hs-boot. When we poke on B.hs and discover that it
has a reference to a type from A, what TyThing should we wire
it up with? Clearly, if we have already typechecked A, we
should use the most up-to-date TyThing: the one we freshly
generated when we typechecked A. But what if we haven't typechecked
it yet?
For the longest time, GHC adopted the policy that this was
*an error condition*; that you MUST NEVER poke on B.hs's reference
to a thing defined in A.hs until A.hs has gotten around to checking
this. However, actually ensuring this is the case has proven
to be a bug farm. The problem was especially poignant with
type family consistency checks, which eagerly happen before
any typechecking takes place.
This patch takes a different strategy: if we ever try to access
an entity from A which doesn't exist, we just fall back on the
definition of A from the hs-boot file. This means that you may
end up with a mix of A.hs and A.hs-boot TyThings during the
course of typechecking.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate
Reviewers: simonpj, bgamari, austin, goldfire
Subscribers: thomie, rwbarton
GHC Trac Issues: #14396
Differential Revision: https://phabricator.haskell.org/D4154
|