| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
xcrun --find seems like the appropriate choice here. Thanks to Brandon
Allbery for suggesting this.
|
| |
|
|
|
|
|
| |
Make it clearer that the final statement should be exactly
"(return|pure) E".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provoked by Trac #11948, this patch adds a new warning to GHC
-Wsimplifiable-class-constraints
It warns if you write a class constraint in a type signature that
can be simplified by an existing instance declaration. Almost always
this means you should simplify it right now; type inference is very
fragile without it, as #11948 shows.
I've put the warning as on-by-default, but I suppose that if there are
howls of protest we can move it out (as happened for -Wredundant-constraints.
It actually found an example of an over-complicated context in CmmNode.
Quite a few tests use these weird contexts to trigger something else,
so I had to suppress the warning in those.
The 'haskeline' library has a few occurrences of the warning (which
I think should be fixed), so I switched it off for that library in
warnings.mk.
The warning itself is done in TcValidity.check_class_pred.
HOWEVER, when type inference fails we get a type error; and the error
suppresses the (informative) warning. So as things stand, the warning
only happens when it doesn't cause a problem. Not sure what to do
about this, but this patch takes us forward, I think.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch finishes off Trac #11450. Following debate on that ticket,
the patch tightens up the rules for what the instances of an
associated type can look like. Now they must match the instance
header exactly. Eg
class C a b where
type T a x b
With this class decl, if we have an instance decl
instance C ty1 ty2 where ...
then the type instance must look like
type T ty1 v ty2 = ...
with exactly
- 'ty1' for 'a'
- 'ty2' for 'b', and
- a variable for 'x'
For example:
instance C [p] Int
type T [p] y Int = (p,y,y)
Previously we allowed multiple instance equations and now, in effect,
we don't since they would all overlap. If you want multiple cases,
use an auxiliary type family.
This is consistent with the treatment of generic-default instances,
and the user manual always said "WARNING: this facility (multiple
instance equations may be withdrawn in the future".
I also improved error messages, and did other minor refactoring.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Read it
Reviewers: hvr, austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D2120
GHC Trac Issues: #11744
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Non-exhaustive pattern warnings had their number of patterns to
show hardcoded in the past. This patch implements the TODO remark
that this should be made a command line flag.
-fmax-uncovered-patterns=<n>
can now be used to influence the number of patterns to be shown.
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2076
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Read it
Reviewers: austin, kosmikus
Reviewed By: kosmikus
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2111
GHC Trac Issues: #11318, #11762
|
| |
|
|
|
|
|
|
|
| |
DsMeta curiously omitted quantified tyvars in certain circumstances.
This patch means it doesn't.
Test case: th/T11797
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Runtime Linker is currently eagerly loading all object files on all
platforms which do not use the system linker for `GHCi`.
The problem with this approach is that it requires all symbols to be
found. Even those of functions never used/called. This makes the number
of libraries required to link things like `mingwex` quite high.
To work around this the `rts` was relying on a trick. It itself was
compiled with `MingW64-w`'s `GCC`. So it was already linked against
`mingwex`. As such, it re-exported the symbols from itself.
While this worked it made it impossible to link against `mingwex` in
user libraries. And with this means no `C99` code could ever run in
`GHCi` on Windows without having the required symbols re-exported from
the rts.
Consequently this rules out a large number of packages on Windows.
SDL2, HMatrix etc.
After talking with @rwbarton I have taken the approach of loading entire
object files when a symbol is needed instead of doing the dependency
tracking on a per symbol basis. This is a lot less fragile and a lot
less complicated to implement.
The changes come down to the following steps:
1) modify the linker to and introduce a new state for ObjectCode:
`Needed`. A Needed object is one that is required for the linking to
succeed. The initial set consists of all Object files passed as
arguments to the link.
2) Change `ObjectCode`'s to be indexed but not initialized or resolved.
This means we know where we would load the symbols,
but haven't actually done so.
3) Mark any `ObjectCode` belonging to `.o` passed as argument
as required: ObjectState `NEEDED`.
4) During `Resolve` object calls, mark all `ObjectCode`
containing the required symbols as `NEEDED`
5) During `lookupSymbol` lookups, (which is called from `linkExpr`
and `linkDecl` in `GHCI.hs`) is the symbol is in a not-yet-loaded
`ObjectCode` then load the `ObjectCode` on demand and return the
address of the symbol. Otherwise produce an unresolved symbols error
as expected.
6) On `unloadObj` we then change the state of the object and remove
it's symbols from the `reqSymHash` table so it can be reloaded.
This change affects all platforms and OSes which use the runtime linker.
It seems there are no real perf tests for `GHCi`, but performance
shouldn't be impacted much. We gain a lot of time not loading all `obj`
files, and we lose some time in `lookupSymbol` when we're finding
sections that have to be loaded. The actual finding itself is O(1)
(Assuming the hashtnl is perfect)
It also consumes slighly more memory as instead of storing just the
address of a symbol I also store some other information, like if the
symbol is weak or not.
This change will break any packages relying on renamed POSIX functions
that were re-named and re-exported by the rts. Any packages following
the proper naming for functions as found on MSDN will work fine.
Test Plan: ./validate on all platforms which use the Runtime linker.
Reviewers: thomie, rwbarton, simonmar, erikd, bgamari, austin, hvr
Reviewed By: erikd
Subscribers: kgardas, gridaphobe, RyanGlScott, simonmar,
rwbarton, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D1805
GHC Trac Issues: #11223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, deriving `Generic(1)` bailed out when attempting to
instantiate visible type parameters (#5939), but this instantiation
check was quite fragile and doesn't interact well with `-XTypeInType`.
It has been decided that `Generic(1)` shouldn't be subjected to this
check anyway, so it has been removed, and `gen_Generic_binds`'s
machinery has been updated to substitute the type variables in a
generated `Rep`/`Rep1` instance with the user-supplied type arguments.
In addition, this also refactors `Condition` in `TcDeriv` a bit. Namely,
since we no longer need `tc_args` to check any conditions, the `[Type]`
component of `Condition` has been removed.
Fixes #11732.
Test Plan: ./validate
Reviewers: goldfire, kosmikus, simonpj, bgamari, austin
Reviewed By: simonpj, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2061
GHC Trac Issues: #5939, #11732
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We originally wanted CallStacks to be opt-in, but dealing with let
binders complicated things, forcing us to infer CallStacks. It turns
out that the inference is actually unnecessary though, we can let the
wanted CallStacks bubble up to the outer context by refusing to
quantify over them. Eventually they'll be solved from a given CallStack
or defaulted to the empty CallStack if they reach the top.
So this patch prevents GHC from quantifying over CallStacks, getting us
back to the original plan. There's a small ugliness to do with
PartialTypeSignatures, if the partial theta contains a CallStack
constraint, we *do* want to quantify over the CallStack; the user asked
us to!
Note that this means that
foo :: _ => CallStack
foo = getCallStack callStack
will be an *empty* CallStack, since we won't infer a CallStack for the
hole in the theta. I think this is the right move though, since we want
CallStacks to be opt-in. One can always write
foo :: (HasCallStack, _) => CallStack
foo = getCallStack callStack
to get the CallStack and still have GHC infer the rest of the theta.
Test Plan: ./validate
Reviewers: goldfire, simonpj, austin, hvr, bgamari
Reviewed By: simonpj, bgamari
Subscribers: bitemyapp, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D1912
GHC Trac Issues: #11573
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`ghc` fails without `-dep-suffix ''`.
Test Plan: visual inspection
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D2075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define MIN_VERSION_pkgname and VERSION_pkgname macros for all exposed
packages, without requiring -hide-all-packages.
See #10970 comment 7-10 for discussion.
Reviewers: duncan, ezyang, bgamari, austin
Reviewed By: ezyang
Subscribers: hvr, rwbarton
Differential Revision: https://phabricator.haskell.org/D1869
GHC Trac Issues: #10970
|
|
|
|
|
|
|
|
|
|
|
|
| |
when in fact it does. This was pointed out by Johannes Bechberger and
supported with seemingly statistically sound evidence in his Bachelor
thesis: Of the benchmark shootout programs, 80% benefit significantly by
switchtng from -O to -O2.
See https://uqudy.serpens.uberspace.de/blog/2016/02/08/ghc-performance-over-time/
for a few raw numbers.
Differential Revision: https://phabricator.haskell.org/D2065
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Read it
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2052
GHC Trac Issues: #7411, #11197, #11554, #11715
|
| |
|
|
|
|
| |
Per Simon's request.
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Proof-read
Reviewers: scpmw, austin
Subscribers: simonmar, thomie
Differential Revision: https://phabricator.haskell.org/D1369
|
|
|
|
|
|
| |
This is a follow-up patch to the previous one for #11726.
It turns out that I'd missed the point of the ticket; this
patch addresses it.
|
|
|
|
| |
Addresses Trac #11726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Remove `.hi` and `.o` files if the flags `no-keep-hi-files` and
`no-keep-o-files` are given.
Test Plan: ./validate
Reviewers: austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2021
GHC Trac Issues: #4114
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the order of required and provided constraint contexts of pattern
synonyms has been switched recently, I updated a couple places in the
users guide's pattern synonym section to accommodate for this.
Test Plan: read it :-)
Reviewers: goldfire, thomie, mpickering, simonpj, austin, bgamari
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D2034
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate and read
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2035
GHC Trac Issues: #11741
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sphinx apparently expects references to anchors that don't accompany a
header to have a caption.
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2033
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Addresses #11549 by defaulting `RuntimeRep` variables to `PtrRepLifted`
and adding a new compiler flag `-fprint-explicit-runtime-reps` to
disable this behavior.
This is just a guess at the right way to go about this. If it's
wrong-beyond-any-hope just say so.
Test Plan: Working on a testcase
Reviewers: goldfire, austin
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D1961
GHC Trac Issues: #11549
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As discussed in #2530 we are going to continue to produce parentheses
here in order to preserve compatibility with previous GHC releases. It
was found that dropped parentheses would break some testsuites which
compared against output from Show. This has been documented in the users
guide.
This reverts commit 5692643c9d17e746327588cd6157a923642b7975.
Test Plan: Validate
Reviewers: hvr, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2027
GHC Trac Issues: #2350
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add "⦇" and "⦈" as unicode alternatives for "(|" and "|)" respectively.
This must be implemented differently than other unicode additions
because ⦇" and "⦈" are interpretted as a $unigraphic rather than
a $unisymbol.
Test Plan: validate
Reviewers: goldfire, bgamari, austin
Reviewed By: bgamari, austin
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2012
GHC Trac Issues: #10162
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds timings and allocation figures to the compiler's output when
run with `-v2` in an effort to ease performance analysis.
Todo:
* Documentation
* Where else should we add these?
* Perhaps we should remove some of the now-arguably-redundant
`showPass` occurrences where they are
* Must we force more?
* Perhaps we should place this behind a `-ftimings` instead of `-v2`
Test Plan: `ghc -v2 Test.hs`, look at the output
Reviewers: hvr, goldfire, simonmar, austin
Reviewed By: simonmar
Subscribers: angerman, michalt, niteria, ezyang, thomie
Differential Revision: https://phabricator.haskell.org/D1959
|
|
|
|
| |
Test cases: typecheck/should_fail/T1172{3,4}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, this allows correct tracking of specified/invisible
for variables in Haskell98 data constructors and in pattern synonyms.
GADT-syntax constructors are harder, and are left until #11721.
This was all inspired by Simon's comments to my fix for #11512,
which this subsumes.
Test case: ghci/scripts/TypeAppData
[skip ci] (The test case fails because of an unrelated problem
fixed in the next commit.)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now check that a CUSK is really a CUSK and issue an error if
it isn't. This also involves more solving and zonking in
kcHsTyVarBndrs, which was the outright bug reported in #11648.
Test cases: polykinds/T11648{,b}
This updates the haddock submodule.
[skip ci]
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
[skip ci]
|
|
|
|
|
| |
This makes it a bit easier to find the description corresponding to
particular flags.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1991
GHC Trac Issues: #9887
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The algorithm for ApplicativeDo rearrangement is based on a heuristic
that runs in O(n^2). This patch adds the optimal algorithm, which is
O(n^3), selected by a flag (-foptimal-applicative-do). It finds better
solutions in a small number of cases (about 2% of the cases where
ApplicativeDo makes a difference), but it can be very slow for large do
expressions. I'm mainly adding it for experimental reasons.
ToDo: user guide docs
Test Plan: validate
Reviewers: simonpj, bgamari, austin, niteria, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1969
|
|
|
|
|
|
|
|
| |
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: read it
Reviewers: austin, goldfire
Reviewed By: goldfire
Subscribers: hvr, thomie
Differential Revision: https://phabricator.haskell.org/D1981
GHC Trac Issues: #11679
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As `-fno-show-warning-groups` shows associated warning groups regardless
of whether the respective warning group flag as been passed on the CLI,
the warning-group information may be confusing to users.
At this point, `-fshow-warning-groups` is useful mostly to GHC
developers and possibly GHC users who want to see which warning groups
an emitted warning is part of. (Btw, this is particularly interesting in
combination with `-Weverything` which enables *every* warning flag known
to GHC.)
Consequently, starting with this commit, one has to opt-in via
`-fshow-warning-groups` for GHC to show warning groups.
In order to reduce the testsuite delta in this commit, the
`-fshow-warning-groups` flag has been added to TEST_HC_OPTS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch was triggered by Trac #11601, where I discovered that
-XStrict was really not doing the right thing. In particular,
f y = let !(Just x) = blah[y] in body[y,x]
This was evaluating 'blah' but not pattern matching it
against Just until x was demanded. This is wrong.
The patch implements a new semantics which ensures that strict
patterns (i.e. ones with an explicit bang, or with -XStrict)
are evaluated fully when bound.
* There are extensive notes in DsUtils:
Note [mkSelectorBinds]
* To do this I found I need one-tuples;
see Note [One-tuples] in TysWiredIn
I updated the user manual to give the new semantics
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both gcc and clang tell which warning flag a reported warning can be
controlled with, this patch makes ghc do the same. More generally, this
allows for annotated compiler output, where an optional annotation is
displayed in brackets after the severity.
This also adds a new flag `-f(no-)show-warning-groups` to control
whether to show which warning-group (such as `-Wall` or `-Wcompat`)
a warning belongs to. This flag is on by default.
This implements #10752
Reviewed By: quchen, bgamari, hvr
Differential Revision: https://phabricator.haskell.org/D1943
|