| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two things here:
* While debugging Trac #14561 I found it hard to understand
ghcPrimIds and magicIds in MkId. This patch adds more
structure and comments.
* I also discovered that ($) no longer needs to be a wiredInId
because we now have levity polymorphism. So I took dollarId
out of MkId; and gave it a levity-polymorphic type in GHC.Base
|
|
|
|
|
|
|
|
| |
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 refactoring has no change in behaviour but makes the
structure clearer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 fixes #14567. The idea is simple: if a function
is marked NOINLINE then it makes a great candidate for a loop
breaker.
Implementation is easy too, but it needs a little extra plubming,
notably the occ_unf_act field in OccEnv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch, which fixes Trac #14566, makes LiberateCase a little
more conservative. In particular:
* In libCaseBind, treat a recursive group as a whole, rather than
binding-by-binding, allowing the group to be duplicated only if
- the bindings /considered together/ are smaller than the
liberate-case threshold (which is large by default)
- none of them are thunks
- none of them are guaranteed-diverging
The latter condidtion is new, and happens to apply in the
case of Data/Typeable/Internal.mkTrApp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactoring
* Renames kcHsTyVarBndrs to kcLHsQTyVars,
which is more truthful. It is only used in getInitialKind.
* Pulls out bind_telescope from that function, and calls it
kcLHsTyVarBndrs, again to reflect its argument
* Uses the new kcLHsTyVarBndrs in kcConDecl, where the old
function was wild overkill.
There should not be any change in behaviour
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This was scheduled to happen for 8.2, it looks like it will actually
happen in 8.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for injecting runtime calls to `trace` in `DsM`. This
allows the desugarer to add compile-time information to a runtime
trace.
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: carter, thomie, rwbarton
Differential Revision: https://phabricator.haskell.org/D4162
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
| |
Silly rabbit, BlockInfoTables are data. This fixes the unregisterised build,
finally fixing #14454.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
blockLbl was originally changed in 8b007abbeb3045900a11529d907a835080129176 to
use mkTempAsmLabel to fix an inconsistency resulting in #14221. However, this
breaks the C code generator, which doesn't support AsmTempLabels (#14454).
Instead let's try going the other direction: use a new CLabel variety,
LocalBlockLabel. Then we can teach the C code generator to deal with
these as well.
|
| |
|
|
|
|
|
|
| |
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4241
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #14449 showed that we were failing to check that the
quantified type variables of a partial type signature remained
distinct.
See Note [Quantified variables in partial type signatures]
in TcBinds.
A little refactoring along the way.
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4232
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: ekmett, austin, bgamari
Reviewed By: bgamari
Subscribers: duog, goldfire, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4155
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Try running nofib on Windows
Reviewers: Phyx
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4222
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate on Linux and Windows
Reviewers: erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4225
|
|
|
|
|
|
| |
Subscribers: rwbarton, thomie, Phyx
Differential Revision: https://phabricator.haskell.org/D4221
|
|
|
|
|
|
| |
This broke the 32-bit build.
This reverts commit f5dc8ccc29429d0a1d011f62b6b430f6ae50290c.
|
|
|
|
|
| |
This output is supposed to be machine-readable; having random line-breaks
defeats this.
|
|
|
|
|
| |
This refactors the dump file setup path, separating concerns a bit. It also
fixes an exception-unsafe usage of openFile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: bgamari, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #14437
Differential Revision: https://phabricator.haskell.org/D4180
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, mpickering
Reviewed By: mpickering
Subscribers: rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D4205
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many industrial users have aligned around the idea that implicit exports
are an anti-pattern. They lead to namespace pollution and byzantine
naming schemes. They also prevent GHC's dead code analysis and create
more obstacles to optimization. This warning allows teams/projects to
warn on or enforce via -Werror explicit export lists.
This warning also serves as a complement to warn-missing-import-lists.
This was originally discussed here:
https://github.com/ghc-proposals/ghc-proposals/pull/93
Test Plan: Three new minimal tests have been added to the type checker.
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4197
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As documented in #14490, the Data instances currently blow up
compilation time by too much to stomach. Alan will continue working on
this in a branch and we will perhaps merge to 8.2 before 8.2.1 to avoid
having to perform painful cherry-picks in 8.2 minor releases.
Reverts haddock submodule.
This reverts commit 47ad6578ea460999b53eb4293c3a3b3017a56d65.
This reverts commit e3ec2e7ae94524ebd111963faf34b84d942265b4.
This reverts commit 438dd1cbba13d35f3452b4dcef3f94ce9a216905.
This reverts commit 0ff152c9e633accca48815e26e59d1af1fe44ceb.
|
|
|
|
|
|
|
|
| |
Reviewers: hvr
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4204
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4210
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, erikd
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4209
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC and the binary distribution that's produced is
not relocatable outside of Windows. This diff tries to
address this for at least Linux and macOS.
Reviewers: austin, hvr, bgamari, erikd, goldfire, Phyx
Reviewed By: bgamari
Subscribers: duog, rwbarton, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D4121
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When building the rts with ghc (e.g. using ghc as a c compiler), ghc's
"Value Add"[1] is, it includes adding `-include /path/to/ghcversion.h`. For
this it looksup the rts package in the package database, which--if
empty--fails. Thus to allow compiling C files with GHC, we add the
`-ghc-version` flag, which takes the path to the `ghcversion.h` file.
A `-no-ghc-version` flag was omitted, as at that point it becomes
questionable why one would use ghc to compile c if one doesn't
any of the added value.
--
[1] from `compiler/main/DriverPipeline.hs`
> -- add package include paths even if we're just compiling .c
> -- files; this is the Value Add(TM) that using ghc instead of
> -- gcc gives you :)
Reviewers: bgamari, geekosaur, austin
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4135
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When sorting by the Ord instance put DEFAULT before other constructors.
This is in line with what the core linter requests allowing the use of
the instance for putting alternatives in the correct order.
This implements #14464.
Reviewers: bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie
GHC Trac Issues: #14464
Differential Revision: https://phabricator.haskell.org/D4198
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4187
|
|
|
|
|
|
|
|
|
|
|
| |
This allows you to use `-ddump-to-file -ddump-timings` for more useful
dump output.
Test Plan: Try it
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4195
|