| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In an instance declaration when you don't specify the code for a
method, GHC fills in from the default binding in the class.
The type of the default method can legitmiately be ambiguous ---
see Note [Default methods in instances] in TcInstDcls --- so
typechecking it can be tricky.
Trac #12220 showed that although we were dealing with that ambiguity
for /vanilla/ default methods, we were not doing so for /generic/
default methods. Moreover we were dealing with it clumsily, by
generating post-typechecked code.
This patch fixes the bug AND deletes code! We now use the same code
path for both vanilla and generic default methods; and generate
/pre-typechecked/ code in both cases. The key trick is that we can use
Visible Type Application to deal with the ambiguity, which wasn't
possible before. Hooray.
There is a small hit to performance in compiler/perf/T1969 which
consists of nothing BUT instance declarations with several default
methods to fill, which we now have to typecheck. The actual hit is
from 724 -> 756 or 4% in that extreme example. Real world programs
have vastly fewer instance decls.
|
|
|
|
|
|
| |
See the user's guide entry or the Note [TcRnExprMode] in TcRnDriver.
Test cases: ghci/scripts/T{10963,11975}
|
|
|
|
|
|
| |
Test cases:
typecheck/should_compile/T11974
typecheck/should_fail/T11974b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to remove the `Ord Unique` instance because there's
no way to implement it in deterministic way and it's too
easy to use by accident.
We sometimes compute SCC for datatypes whose Ord instance
is implemented in terms of Unique. The Ord constraint on
SCC is just an artifact of some internal data structures.
We can have an alternative implementation with a data
structure that uses Uniquable instead.
This does exactly that and I'm pleased that I didn't have
to introduce any duplication to do that.
Test Plan:
./validate
I looked at performance tests and it's a tiny bit better.
Reviewers: bgamari, simonmar, ezyang, austin, goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2359
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch uses collectArgsTicks instead of collectArgs to test that
StaticPtr only occurs at the top of RHSs of top-level expressions.
Ticks introduced by -fhpc would interfere otherwise.
Test Plan: ./validate
Reviewers: thomie, austin, goldfire, bgamari, simonpj
Reviewed By: simonpj
Differential Revision: https://phabricator.haskell.org/D2355
GHC Trac Issues: #12207
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Trac #11948 I added the warning
-Wsimplifiable-class-constraints
which warns if the class constraints in a type signature are
simplifiable.
But in fact the fragility it warns about only happens with
NoMonoLocalBinds, so this patch switches off the warning if
you have MonoLocalBinds (and suggests using it in the error
message).
See Note [Simplifiable given constraints] in TcValidity.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #12175, another delicate corner case of
Note [Instance and Given overlap] in TcInteract.
In #12175 we were not expanding given superclasses eagerly
enough. It was easy to fix, and is actually rather neater than
before.
See Note [Eagerly expand given superclasses] in TcCanonical.
The main change is to move the eager expansion of given superclasses
to canClassNC.
|
|
|
|
| |
Fixes Trac #12163. Pretty simple.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `Ord Module` instance currently uses `Unique`s for comparison.
We don't want to use the `Unique` order because it can introduce
nondeterminism.
This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic
ordering making `Ord Module` deterministic transitively.
I've run `nofib` and it doesn't make a measurable difference.
See also Note [ModuleEnv determinism and performance].
This fixes #12191 - the regression, that the previous version of this
patch had.
Test Plan:
./validate
run nofib: P112
Reviewers: simonmar, bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2354
GHC Trac Issues: #4012, #12191
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing canonicalization on every comparison turned
out to be very expensive.
Caching the canonicalization through the smart `modulePair` constructor
gives `8%` reduction in allocations on `haddock.compiler` and
`8.5%` reduction in allocations on `haddock.Cabal`.
Possibly other things as well, but it's really visible in Haddock.
Test Plan: ./validate
Reviewers: jstolarek, simonpj, austin, simonmar, bgamari
Reviewed By: simonpj, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2350
GHC Trac Issues: #12191
|
|
|
|
|
|
|
| |
This fixes Trac #12212. It's quite hard to provoke, but I've
added a standalone test case that does so.
The issue is explained in Note [Evidence foralls] in Specialise.
|
| |
|
|
|
|
|
|
| |
* Set config settings directly in mk/test.mk, instead of indirectly in
config/ghc
* passing --hpcdir for WAY=hpc is unnecessary
|
|
|
|
| |
This allows the removal of the override_flags stuff in testlib.py.
|
|
|
|
|
| |
The previous commits removed `-fforce-recomp` from TEST_HC_OPTS, so
TEST_HC_OPTS_NO_RECOMP = TEST_HC_OPTS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need for this flag anymore, since each test runs in a
newly created directory. Removing it cleans up testlib.py a bit.
There is a small risk that this renders some tests useless. It's hard to
know. Those tests should have specified -fforce-recomp` explicitly
anyway, so I'm not going to worry about it. I've fixed the ones that
failed without -fforce-recomp.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D2346
|
|
|
|
|
|
|
|
|
| |
* CgStaticPointers, GcStaticPointers, ListStaticPointers,
TcStaticPointers01, TcStaticPointers02: #12207
* T11535: #12210
* ffi017/ffi021: #12209
* T11108: #11108
* T9646: #9646
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
There's a precedent for special-casing $, as we already have special
typing rules for it.
Test Plan: validate; new test cases
Reviewers: ezyang, austin, niteria, bgamari, simonpj, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2345
GHC Trac Issues: #11835
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux 64-bit PowerPC the first 13 floating point parameters are
passed in registers. We only passed the first 8 floating point params.
The alignment of a floating point single precision value in ELF v1.9 is
the second word of a doubleword. For ELF v2 we support only little
endian and the least significant word of a doubleword is the first word,
so no special handling is required.
Add a regression test.
Test Plan: validate on powerpc Linux and AIX
Reviewers: erikd, hvr, austin, simonmar, bgamari
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2327
GHC Trac Issues: #12134
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using TH to splice expressions involving record field construction,
the parent datacon may not be in scope. We shouldn't panic about this,
because we will be renaming Exact RdrNames which don't require any
disambiguation.
Test Plan: new test th/T12130
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2321
GHC Trac Issues: #12130
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, derived implementations of `to`/`from` in `Generic`
instances were wastefully putting extra `M1`s in every case, which led
to an O(n) increase in the number of coercions, resulting in a slowdown
during the typechecker phase.
This factors out the common `M1` in every case of a `to`/`from`
definition so that the typechecker has far fewer coercions to deal with.
For a datatype with 300 constructors, this change has been observed to
save almost 3 seconds of compilation time.
This is one step towards coming up with a solution for #5642.
Test Plan: ./validate
Reviewers: hvr, austin, simonpj, bgamari
Reviewed By: bgamari
Subscribers: basvandijk, carter, thomie, osa1
Differential Revision: https://phabricator.haskell.org/D2304
GHC Trac Issues: #5642
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds `Data.Bifoldable` and `Data.Bitraversable` from the
`bifunctors` package to `base`, completing the migration started in
D336. This is fairly straightforward, although there were a suprising
amount of reinternal organization in `base` that was needed for this to
happen:
* `Data.Foldable`, `Data.Traversable`, `Data.Bifoldable`, and
`Data.Bitraversable` share some nonexported datatypes (e.g., `StateL`,
`StateR`, `Min`, `Max`, etc.) to implement some instances. To avoid
code duplication, I migrated this internal code to a new hidden
module, `Data.Functor.Utils` (better naming suggestions welcome).
* `Data.Traversable` and `Data.Bitraversable` also make use of an
identity newtype, so I modified them to use
`Data.Functor.Identity.Identity`. This has a ripple effect on several
other modules, since I had to move instances around in order to avoid
dependency cycles.
Fixes #10448.
Reviewers: ekmett, hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2284
GHC Trac Issues: #9682, #10448
|
|
|
|
|
|
|
|
|
|
|
| |
* See `Note [Why is there no stage1 setup function?]`.
* Move T2632 to the tests/stage1 directory (#10382).
Reviewed by: ezyang, nomeata, bgamari
Differential Revision: https://phabricator.haskell.org/D2341
GHC Trac Issues: #12197
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As discussed in Phab:D1187, this approach makes it a bit easier to
inspect the test directory while working on a new test.
The only tests that needed changes are the ones that refer to files in
ancestor directories. Those files are now copied directly into the test
directory.
validate still runs the tests in a temporary directory in /tmp, see
`Note [Running tests in /tmp]` in testsuite/driver/runtests.py.
Update submodule hpc.
Reviewed by: simonmar
Differential Revision: https://phabricator.haskell.org/D2333
GHC Trac Issues: #11980
|
|
|
|
|
|
|
|
| |
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D2331
GHC Trac Issues: #12192
|
|
|
|
|
| |
- Move the numaMap and nNumaNodes out of RtsFlags to Capability.c
- Add a test to tests/rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, following the TypeInType innovations,
each TyCon had two lists:
- tyConBinders :: [TyBinder]
- tyConTyVars :: [TyVar]
They were in 1-1 correspondence and contained
overlapping information. More broadly, there were many
places where we had to pass around this pair of lists,
instead of a single list.
This commit tidies all that up, by having just one list of
binders in a TyCon:
- tyConBinders :: [TyConBinder]
The new data types look like this:
Var.hs:
data TyVarBndr tyvar vis = TvBndr tyvar vis
data VisibilityFlag = Visible | Specified | Invisible
type TyVarBinder = TyVarBndr TyVar VisibilityFlag
TyCon.hs:
type TyConBinder = TyVarBndr TyVar TyConBndrVis
data TyConBndrVis
= NamedTCB VisibilityFlag
| AnonTCB
TyCoRep.hs:
data TyBinder
= Named TyVarBinder
| Anon Type
Note that Var.TyVarBdr has moved from TyCoRep and has been
made polymorphic in the tyvar and visiblity fields:
type TyVarBinder = TyVarBndr TyVar VisibilityFlag
-- Used in ForAllTy
type TyConBinder = TyVarBndr TyVar TyConBndrVis
-- Used in TyCon
type IfaceForAllBndr = TyVarBndr IfaceTvBndr VisibilityFlag
type IfaceTyConBinder = TyVarBndr IfaceTvBndr TyConBndrVis
-- Ditto, in interface files
There are a zillion knock-on changes, but everything
arises from these types. It was a bit fiddly to get the
module loops to work out right!
Some smaller points
~~~~~~~~~~~~~~~~~~~
* Nice new functions
TysPrim.mkTemplateKiTyVars
TysPrim.mkTemplateTyConBinders
which help you make the tyvar binders for dependently-typed
TyCons. See comments with their definition.
* The change showed up a bug in TcGenGenerics.tc_mkRepTy, where the code
was making an assumption about the order of the kind variables in the
kind of GHC.Generics.(:.:). I fixed this; see TcGenGenerics.mkComp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With TypeInType Richard combined ForAllTy and FunTy, but that was often
awkward, and yielded little benefit becuase in practice the two were
always treated separately. This patch re-introduces FunTy. Specfically
* New type
data TyVarBinder = TvBndr TyVar VisibilityFlag
This /always/ has a TyVar it. In many places that's just what
what we want, so there are /lots/ of TyBinder -> TyVarBinder changes
* TyBinder still exists:
data TyBinder = Named TyVarBinder | Anon Type
* data Type = ForAllTy TyVarBinder Type
| FunTy Type Type
| ....
There are a LOT of knock-on changes, but they are all routine.
The Haddock submodule needs to be updated too
|
|
|
|
|
|
| |
..in typecheck/should_run/T7861
Was concealed behind the haddock perf noise
|
|
|
|
|
|
|
| |
This reverts commit 0497ee504cc9ac5d6babee9b98bf779b3fc50b98.
Reason: See Trac #12191. I'm reverting pending Bartosz's
investigation of what went wrong.
|
|
|
|
|
| |
This test didn't have a `.T` file, so the testsuite driver never ran it.
Luckily the features it tested for didn't break in the past 8 years.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `Ord Module` instance currently uses `Unique`s for comparison.
We don't want to use the `Unique` order because it can introduce nondeterminism.
This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic ordering
making `Ord Module` deterministic transitively.
I've run `nofib` and it doesn't make a measurable difference.
See also Note [ModuleEnv determinism and performance].
Test Plan:
./validate
run nofib: P112
Reviewers: simonpj, simonmar, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2030
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Code already existed in the RTS to add thin library support for non-Windows
operating systems. This adds it to Windows as well.
ar thin libraries have the exact same format as normal archives except they
have a different magic string and they don't copy the object files into the
archive.
Instead each header entry points to the location of the object file on disk.
This is useful when a library is only created to satisfy a compile time dependency
instead of to be distributed. This saves the time required for copying.
Test Plan: ./validate and new test T11788
Reviewers: austin, bgamari, simonmar, erikd
Reviewed By: bgamari, simonmar
Subscribers: thomie, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2323
GHC Trac Issues: #11788
|
|
|
|
|
| |
This one omits the extension, thereby making GHC 8.0 produce
"GHC internal error".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This major commit was initially triggered by #11339, but it spiraled
into a major review of the way in which type signatures for bindings
are handled, especially partial type signatures. On the way I fixed a
number of other bugs, namely
#12069
#12033
#11700
#11339
#11670
The main change is that I completely reorganised the way in which type
signatures in bindings are handled. The new story is in TcSigs
Note [Overview of type signatures]. Some specific:
* Changes in the data types for signatures in TcRnTypes:
TcIdSigInfo and new TcIdSigInst
* New module TcSigs deals with typechecking type signatures
and pragmas. It contains code mostly moved from TcBinds,
which is already too big
* HsTypes: I swapped the nesting of HsWildCardBndrs
and HsImplicitBndsrs, so that the wildcards are on the
oustide not the insidde in a LHsSigWcType. This is just
a matter of convenient, nothing deep.
There are a host of other changes as knock-on effects, and
it all took FAR longer than I anticipated :-). But it is
a significant improvement, I think.
Lots of error messages changed slightly, some just variants but
some modest improvements.
New tests
* typecheck/should_compile
* SigTyVars: a scoped-tyvar test
* ExPat, ExPatFail: existential pattern bindings
* T12069
* T11700
* T11339
* partial-sigs/should_compile
* T12033
* T11339a
* T11670
One thing to check:
* Small change to output from ghc-api/landmines.
Need to check with Alan Zimmerman
|
| |
|